<template>
  <pageTabelLayout>
    <template #pageHeader>
      <!-- 新增计划订单 -->
      <div class="my-header">
        <div style="height: 24px;width: 100%;border-bottom: 1px solid #e5e7eb; margin-bottom: 15px;"></div>
        <div class="search-form" v-if="headerShow">
          <a-form :model="fromList" size="mini" layout="inline" label-align="right">
            <a-form-item field="endTime" label="下单日期" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-date-picker  popup-container="html"  v-model="fromList.endTime" style="width: 200px;" /> -->
              <a-range-picker popup-container="html" class="bacClass" @change="onChange" @select="onSelect"/>
            </a-form-item>
            <a-form-item field="clientDyeCode" label="染整单号" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-input v-model="fromList.ColorId" /> -->
              <a-select popup-container="html" class="bacClass" :allowClear="true" @search="rzdhs"
                        v-model="fromList.clientDyeCode" :filter-option="false" allow-search @focus="rzdhs('')"
                        :trigger-props="{ autoFitPopupMinWidth: true }">
                <a-option v-for="item in rzdList" :label="item.clientDyeCode" :value="item.clientDyeCode">{{
                    item.clientDyeCode
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item field="customName" label="客户名称" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-input v-model="fromList.ColorName" /> -->
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="handleSearch" v-model="fromList.customName" :filter-option="false" allow-search
                        @focus="focusSel(2)" :trigger-props="{ autoFitPopupMinWidth: true }">
                <a-option v-for="item in pageDataList" :label="item['customName']"
                          :value="item['customName']">{{
                    item['customName']
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item field="finishedClothCode" label="成品布号" :style="{ width: '300px' }"
                         label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.customName" allow-clear>
                                        <a-option v-for="item of basicData.custom" :value="item.id" :key="item.id"
                                            :label="item.customName" />
                                    </a-select> -->
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="handleSearchBh" v-model="fromList.finishedClothCode" :filter-option="false"
                        allow-search @focus="focusSelBh" :trigger-props="{ autoFitPopupMinWidth: true }">
                <a-option v-for="item in pageDataList" :label="item['clothCode']"
                          :value="item['clothCode']">{{
                    item['clothCode']
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item label="交货日期" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.clientDyeCode" allow-clear>

                                    </a-select> -->
              <a-range-picker popup-container="html" class="bacClass" @change="onChange1"
                              @select="onSelect1"/>

            </a-form-item>
            <a-form-item field="customOrderCode" label="客订单号" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.genDanCode" allow-clear>

                                    </a-select> -->
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="handleSearch" v-model="fromList.customOrderCode" :filter-option="false"
                        allow-search @focus="focusSel(3)" :trigger-props="{ autoFitPopupMinWidth: true }"
                        @change="selectChange">
                <a-option v-for="item in pageDataList" :label="item['customOrderCode']"
                          :value="item['customOrderCode']">{{ item['customOrderCode'] }}
                </a-option>
              </a-select>

            </a-form-item>
            <a-form-item field="customOrderName" label="客订名称" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.dyType" allow-clear>
                                        <a-option v-for="item of basicData.orderNature" :value="item.id" :key="item.id"
                                            :label="item.detailName" />
                                    </a-select> -->
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="kdhs" v-model="fromList.customOrderName" :filter-option="false" allow-search
                        @focus="kdhs('')" :trigger-props="{ autoFitPopupMinWidth: true }">
                <a-option v-for="item in kdList" :label="item.customOrderName"
                          :value="item.customOrderName">{{ item.customOrderName }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item field="greyCode" label="坯布编号" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.account" allow-clear>
                                        <a-option v-for="item of basicData.hrEmployee" :value="item.id" :key="item.id"
                                            :label="item.text" />
                                    </a-select> -->
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="pbbh" v-model="fromList.greyCode" :filter-option="false" allow-search
                        @click="pbbh('')" :trigger-props="{ autoFitPopupMinWidth: true }">
                <a-option v-for="item in greyCodeList" :label="item['greyCode']"
                          :value="item['greyCode']">{{
                    item['greyCode']
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item field="colorCode" label="色号" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.clientDyeCode" allow-clear>

                                    </a-select> -->
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="handleSearchSh" v-model="fromList.colorCode" :filter-option="false" allow-search
                        @focus="focusSelSh(1)" :trigger-props="{ autoFitPopupMinWidth: true }"
                        @change="selectChange">
                <a-option v-for="item in pageDataList" :label="item['colorCode']"
                          :value="item['colorCode']">{{
                    item['colorCode']
                  }}
                </a-option>
              </a-select>

            </a-form-item>
            <a-form-item field="colorName" label="色称" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.genDanCode" allow-clear>

                                    </a-select> -->
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="handleSearch" v-model="fromList.colorName" :filter-option="false" allow-search
                        @focus="focusSelSh(2)" :trigger-props="{ autoFitPopupMinWidth: true }"
                        @change="selectChange">
                <a-option v-for="item in pageDataList" :label="item['colorName']"
                          :value="item['colorName']">{{
                    item['colorName']
                  }}
                </a-option>
              </a-select>

            </a-form-item>
            <a-form-item field="orderNature" label="订单性质" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.dyType" allow-clear>
                                        <a-option v-for="item of basicData.orderNature" :value="item.id" :key="item.id"
                                            :label="item.detailName" />
                                    </a-select> -->
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="ddxz" v-model="fromList.orderNature" :filter-option="false" allow-search
                        @focus="ddxz('')" :trigger-props="{ autoFitPopupMinWidth: true }" @change="selectChange">
                <a-option v-for="item in ddxzList" :label="item['detailName']"
                          :value="item['detailName']">{{
                    item['detailName']
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item field="placeDepartment" label="下单部门" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.account" allow-clear>
                                        <a-option v-for="item of basicData.hrEmployee" :value="item.id" :key="item.id"
                                            :label="item.text" />
                                    </a-select> -->
              <a-select popup-container="html" class="bacClass" :allowClear="true" @search="xdhs"
                        v-model="fromList.placeDepartment" :filter-option="false" allow-search
                        :trigger-props="{ autoFitPopupMinWidth: true }" @change="selectChange" @focus="xdhs('')">
                <a-option v-for="item in xdList" :label="item.name" :value="item.name">{{
                    item.name
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item field="auditState" label="订单状态" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.clientDyeCode" allow-clear>

                                    </a-select> -->
              <a-select popup-container="html" class="bacClass" :style="{ width: '320px' }"
                        v-model="fromList.auditState">
                <a-option :value="1">已审核</a-option>
                <a-option :value='0'>未审核</a-option>
              </a-select>

            </a-form-item>
            <a-form-item field="craftState" label="工艺状态" :style="{ width: '300px' }" label-col-flex="82px">
              <a-select popup-container="html" class="bacClass" v-model="fromList.craftState">
                <a-option value="ok">所有工艺</a-option>
                <a-option value="Y1">布号不存在</a-option>
                <a-option value="Y2">工艺流程不存在</a-option>
                <a-option value="Y3">坯布编号不存在</a-option>
              </a-select>

            </a-form-item>
            <a-form-item field="openOrderState" label="开单状态" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.dyType" allow-clear>
                                        <a-option v-for="item of basicData.orderNature" :value="item.id" :key="item.id"
                                            :label="item.detailName" />
                                    </a-select> -->
              <a-select popup-container="html" class="bacClass" v-model="fromList.openOrderState">
                <a-option value="ok">已开齐</a-option>
                <a-option value="Y1">待开单：有坯布未开齐</a-option>
                <a-option value="Y2">欠坯：没有坯布库存</a-option>
              </a-select>
            </a-form-item>
            <a-form-item field="cards" label="已下流转卡号" :style="{ width: '300px' }" label-col-flex="82px">
              <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="fromList.account" allow-clear>
                                        <a-option v-for="item of basicData.hrEmployee" :value="item.id" :key="item.id"
                                            :label="item.text" />
                                    </a-select> -->
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="handleSearch" v-model="fromList.cards" :filter-option="false" @focus="focusSelLz"
                        :trigger-props="{ autoFitPopupMinWidth: true }" multiple>
                <a-option v-for="item in pageDataList" :label="item['flowCardCode']"
                          :value="item['flowCardCode']">{{ item['flowCardCode'] }}
                </a-option>
              </a-select>
            </a-form-item>

          </a-form>

        </div>
        <div class="my-tool-bar" style="float: right;">
          <div class="bg-container-1">
            <div>
              <el-button type="primary" :icon="Search" class="stbutencx" @click="selectHandler">查询</el-button>
              <el-button type="success" :icon="CirclePlus" class="stbutenxz"
                         @click="addHandler">新增
              </el-button>
              <el-button plain :icon="Delete" @click="deleteHandler">删除</el-button>
              <el-button plain v-if="shen == 0" :icon="EditPen" @click="changeGetS(1)">审核</el-button>
              <el-button plain v-if="shen == 1" :icon="EditPen" @click="changeGetS(0)">反审</el-button>
              <el-button plain v-if="shen == 0" @click="bulkEdit(0)">交期修改</el-button>
              <el-button plain v-if="shen == 0" @click="bulkEdit(1)">指定缸型</el-button>
              <el-button plain v-if="shen == 0" @click="bulkEdit(2)">指定车间</el-button>
            </div>
          </div>
        </div>
        <div class="my-divisders">
          <a-divider orientation="center">
            <icon-double-up v-if="headerShow" @click="headerShow = false" :strokeWidth="2" :size="18"/>
            <icon-double-down v-else @click="headerShow = true" :strokeWidth="2" :size="18"/>
          </a-divider>
        </div>
      </div>
    </template>
    <template #pageTabel>
      <a-tabs   :lazy-load="true" default-active-key="0" @change="changeGet">
        <a-tab-pane key="0" title="待审核" style="height: 100%">
          <!-- <AgGridVuesCopys style="height:72vh;" class="ag-theme-alpine " :columnDefs="tc"
                        :rowData="tableCon.tableConter" :defaultColDef="defaultColDef" rowSelection="multiple"
                        @grid-ready="gridReady" :enableColResize="true">
                    </AgGridVuesCopys> -->
          <!-- <AgGridVuesCopys style="height:53vh" class="ag-theme-alpine" :columnDefs="tc"
                        :rowData="tableCon.tableConter" :defaultColDef="defaultColDef" :enableColResize="true"
                        rowSelection="multiple" @grid-ready="gridReady">
                    </AgGridVuesCopys> -->
          <AgGridVuesCopys :rowHeight="33" :headerHeight="33" style="height:calc(100% - 90px)"
                           :suppressCopyRowsToClipboard="true"
                           rowSelection="multiple" @grid-ready="gridReady" :defaultColDef="defaultColDef"
                           class='ag-theme-alpine' :rowData="tableCon.tableConter" :columnDefs="tc"
                           :localeText="localeText1"
                           @dblclick="agCellClicks">
          </AgGridVuesCopys>
          <paginationCopys :total="paging.total" :page-size="paging.size" v-model:current='pages' show-page-size
                           show-total show-jumper
                           size="mini" @change="pagingChange" @page-size-change="pagingSizeChange"/>
        </a-tab-pane>

        <a-tab-pane key="1" title="已审核" style="height: 100%">
          <AgGridVuesCopys :suppressCopyRowsToClipboard="true" style="height:calc(100% - 90px)" class="ag-theme-alpine "
                           rowSelection="multiple" :columnDefs="tc" :rowData="tableConA.tableConter"
                           :defaultColDef="defaultColDef" @grid-ready="gridReadyA" :localeText="localeText1"
                           @dblclick="agCellClicks">
          </AgGridVuesCopys>
          <paginationCopys :total="paging.total" :page-size="paging.size" v-model:current='pages' show-page-size
                           show-total show-jumper
                           size="mini" @change="pagingChange" @page-size-change="pagingSizeChange"/>
        </a-tab-pane>
      </a-tabs>
    </template>
    <a-drawer style="z-index: 999" :style="{ zIndex: 999 }" height="100%" :mask-closable="false"
              popup-container=".table-page-body" placement="bottom" :visible="Tchoocl.showAdd" unmountOnClose
              @cancel="Tchoocl.showAdd = false">
      <template #title>
        {{ pageData.sideTitle }}
        <!-- 新增计划订单 -->
      </template>
      <template #footer>
        <a-button @click="Tchoocl.showAdd = false">关闭</a-button>
      </template>
      <div class="scfs">
        <div class="my-header">
          <div style="position:relative; top:10px; height:30px;width:100%">
            <div style="position: absolute; right: 10px;">
              <a-space>
                <el-button type="success" :icon="CirclePlus" class="stbutenxz" @click="planOrderDetailsAdd"
                           v-if="objectOP.letmap1 != 2">新增行
                </el-button>
                <a-button type="outline" @click="save" v-if="objectOP.letmap1 != 2">保存</a-button>
                <!-- <a-button type="outline">查询</a-button>
                          <a-button type="outline" @click="planOrderDetailsAdd">新增</a-button> -->
                <a-button v-if="objectOP.letmap1 == 0" type="outline" @click="toExamine('1')">审核</a-button>
                <!-- <a-button v-if="objectOP.letmap1 == 0" type="outline" @click="toExamine('0')">反审</a-button> -->
                <a-button v-if="objectOP.letmap1 == 0" type="outline"
                          @click="onToCilck('/DyeingFactory/PDMProductMasterData/FabricInformationList')">成品面料信息维护
                </a-button>
                <a-button v-if="objectOP.letmap1 == 0" type="outline" @click="exCustomer">导入台巨客户</a-button>
              </a-space>
            </div>
            <div>
              <a-form :model="form.a" :disabled="objectOP.letmap1 == 2">
                <a-row>
                  <a-col :span="5">
                    <a-form-item field="createName" label="制单" label-col-flex="50px">
                      <a-input disabled v-model="form.a.createName" style="width:270px"/>
                    </a-form-item>
                  </a-col>
                  <a-col :span="5">
                    <a-form-item field="auditName" label="审核" label-col-flex="50px">
                      <a-input disabled v-model="form.a.auditName" style="width:270px"/>
                    </a-form-item>
                  </a-col>
                  <a-col :span="5">
                    <!-- <el-button type="primary" :icon="Search" class="stbutencx"
                                      style="margin-left: 5px;">查询</el-button>  -->

                  </a-col>

                </a-row>
              </a-form>
              <!-- <el-button type="success" :icon="CirclePlus" class="stbutenxz"
              @click="planOrderDetailsAdd">新增</el-button> -->
            </div>
          </div>
          <div style="height: 24px;width: 100%;border-bottom: 1px solid #e5e7eb; margin-bottom: 15px;"></div>
          <div class="search-form" v-if="headerShow">
            <el-row>
              <el-col :span="13">
                <div class="grid-content ep-bg-purple">
                  <a-form ref="formRef" :model="form.a" :disabled="objectOP.letmap1 == 2">
                    <a-row>
                      <a-col :span="8">
                        <a-form-item field="authorizedStrengthTime" label="下单日期" label-col-flex="110px">
                          <a-date-picker popup-container="html" class="bacClass"
                                         v-model="form.a.authorizedStrengthTime" style="width: 270px;"/>
                        </a-form-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-item field="orderCode" label="订单号" label-col-flex="110px">
                          <!-- <a-select popup-container="html"  :style="{ width: '320px' }" v-model="form.a.authorizedStrengthTime" allow-clear>
                              </a-select> -->
                          <!-- <a-date-picker  popup-container="html"  v-model="form.a.authorizedStrengthTime" style="width: 270px;" /> -->
                          <a-input class="bacClass" v-model="form.a.orderCode" readonly
                                   style="width:270px"/>
                        </a-form-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-item field="placeDepartment" label="下单部门" label-col-flex="110px">
                          <!-- <a-select popup-container="html"  :style="{ width: '270px' }" v-model="form.a.placeDepartment" @focus="placeDepartmentFun">
                                                  <a-option v-for="item of basicData.ProductionMode" :value="item.id"
                                                      :key="item.id" :label="item.productionMode" />
                                              </a-select> -->
                          <a-select popup-container="html" class="bacClass" :loading="loading"
                                    :allowClear="true" @search="placeDepartmentSear"
                                    v-model="form.a.placeDepartment" :filter-option="false" allow-search
                                    style="width:270px;" :trigger-props="{ autoFitPopupMinWidth: true }"
                                    @focus="placeDepartmentFun">
                            <a-option v-for="item in pageDataList" :label="item['name']"
                                      :value="item['name']">{{
                                item['name']
                              }}
                            </a-option>
                          </a-select>
                        </a-form-item>
                      </a-col>

                      <a-col :span="8">
                        <a-form-item field="lastDeliveryTime" label="交货日期" label-col-flex="110px">
                          <a-date-picker popup-container="html" class="bacClass" @click="Confirmed()"
                                         v-model="form.a.lastDeliveryTime" style="width: 270px;"/>
                        </a-form-item>
                      </a-col>

                      <a-col :span="8">
                        <a-form-item field="clientDyeCode" label="客染整单号" label-col-flex="110px">
                          <a-input class="bacClass" v-model="form.a.clientDyeCode"
                                   style="width:270px"/>
                        </a-form-item>
                      </a-col>


                      <a-col :span="8">
                        <a-form-item field="testCriterion" label="测试标准" label-col-flex="110px">
                          <a-select popup-container="html" class="bacClass"
                                    :style="{ width: '270px' }" v-model="form.a.testCriterion" allow-clear
                                    @focus="testCriterionFun">
                            <a-option v-for="item of basicData.VerifyStandard" :value="item['id']"
                                      :key="item['id']" :label="item['verifyStandard']"
                                      @click="testCriterionCk(item['verifyStandard'])"/>
                          </a-select>
                        </a-form-item>
                      </a-col>


                      <a-col :span="8">
                        <a-form-item field="dyeAuditDate" label="总部审核时间" label-col-flex="110px">
                          <a-date-picker popup-container="html" class="bacClass"
                                         v-model="form.a.dyeAuditDate" style="width: 270px;"/>
                        </a-form-item>
                      </a-col>

                      <a-col :span="8">
                        <a-form-item field="customOrderCode" label="客户订单号" label-col-flex="110px">
                          <a-input class="bacClass" v-model="form.a.customOrderCode"
                                   style="width:270px"/>
                        </a-form-item>
                      </a-col>

                      <a-col :span="8">
                        <a-form-item field="coloringIlluminant" label="对色光源" label-col-flex="110px">
                          <a-select popup-container="html" class="bacClass" :loading="loading"
                                    :allowClear="true" @search="coloringIlluminantSear"
                                    v-model="form.a.coloringIlluminant" :filter-option="false" allow-search
                                    style="width:270px;" :trigger-props="{ autoFitPopupMinWidth: true }"
                                    @change="selectChange" @focus="coloringIlluminantFun">
                            <a-option v-for="item in pageDataList" :label="item['colourLight']"
                                      :value="item['colourLight']">{{ item['colourLight'] }}
                            </a-option>
                          </a-select>
                        </a-form-item>
                      </a-col>


                      <a-col :span="8">
                        <a-form-item field="customName" label="客户名称" label-col-flex="110px"
                                     :validate-trigger="['change', 'blur']"
                                     :rules="[{ required: true, message: '客户名称必填' }]">

                          <!-- <a-select popup-container="html"  v-if="showJu" :style="{ width: '270px' }" v-model="form.a.customName">
                                      <a-option v-for="item of basicData.custom" :value="item.id" :key="item.id"
                                          :label="item.customName" />
                                  </a-select>

                                  <a-select popup-container="html"  v-else="showJu" :style="{ width: '270px' }" v-model="form.a.customName" disabled>
                                      <a-option v-for="item of basicData.custom" :value="item.id" :key="item.id"
                                          :label="item.customName" />
                                  </a-select> -->

                          <a-select popup-container="html" class="bacClass" :loading="loading"
                                    :allowClear="true" @search="customNameSear" v-model="form.a.customName"
                                    :filter-option="false" allow-search style="width:270px;"
                                    :trigger-props="{ autoFitPopupMinWidth: true }" @focus="customNameFun"
                                    @chenge="orderCodeFun">
                            <a-option v-for="item in pageDataList" :label="item['customName']"
                                      :value="item['customName']"
                                      @click="deliveryAddressAll(item['id'])">{{
                                item['customName']
                              }}
                            </a-option>
                          </a-select>

                        </a-form-item>
                      </a-col>

                      <a-col :span="8">
                        <a-form-item field="orderNature" label="订单性质" label-col-flex="110px">
                          <a-select popup-container="html" class="bacClass"
                                    :style="{ width: '270px' }" v-model="form.a.orderNature" allow-clear
                                    @focus="orderNatureFun('订单性质')">
                            <a-option v-for="item of basicData.orderNature" :value="item['id']"
                                      :key="item['id']" :label="item['detailName']"/>
                          </a-select>
                        </a-form-item>
                      </a-col>

                      <a-col :span="8">
                        <a-form-item field="labelFormatCode" label="标签格式" label-col-flex="110px">
                          <!-- <a-select popup-container="html"  :style="{ width: '270px' }" v-model="form.a.labelFormatCode" allow-clear>
                                      <a-option v-for="item of basicData.labelFormat" :value="item.id" :key="item.id"
                                          :label="item.labelFormat" />
                                  </a-select> -->

                          <a-select popup-container="html" class="bacClass" :loading="loading"
                                    :allowClear="true" @search="labelFormatCodeSear"
                                    v-model="form.a.labelFormatCode" :filter-option="false" allow-search
                                    style="width:270px;" :trigger-props="{ autoFitPopupMinWidth: true }"
                                    @change="selectChange" @focus="labelFormatCodeFun">
                            <a-option v-for="item in pageDataList" :label="item['labelFormat']"
                                      :value="item['labelFormat']">{{ item['labelFormat'] }}
                            </a-option>
                          </a-select>
                        </a-form-item>
                      </a-col>

                      <a-col :span="8">
                        <a-form-item field="customOrderName" label="客订名称" label-col-flex="110px">
                          <a-input class="bacClass" v-if="showJu" v-model="form.a.customOrderName"
                                   style="width:270px"/>
                          <a-input class="bacClass" v-else="showJu" v-model="form.a.customOrderName"
                                   readonly style="width:270px"/>
                        </a-form-item>
                      </a-col>

                      <a-col :span="8">
                        <a-form-item field="repairCause" label="回修原因" label-col-flex="110px">
                          <!-- <a-input v-model="form.a.repairCause" style="width:270px" /> -->
                          <a-select popup-container="html" class="bacClass" :loading="loading"
                                    :allowClear="true" @search="repairCauseSear"
                                    v-model="form.a.repairCause" :filter-option="false" allow-search
                                    style="width:270px;" :trigger-props="{ autoFitPopupMinWidth: true }"
                                    @change="selectChange" @focus="repairCauseFun">
                            <a-option v-for="item in pageDataList" :label="item['repairCause']"
                                      :value="item['repairCause']">{{ item['repairCause'] }}
                            </a-option>
                          </a-select>
                        </a-form-item>
                      </a-col>

                      <a-col :span="8">
                        <a-form-item field="deliveryAddress" label="送货地址" label-col-flex="110px">
                          <a-input class="bacClass" v-model="form.a.deliveryAddress"
                                   style="width:270px"/>
                        </a-form-item>
                      </a-col>


                      <a-col :span="8">
                        <a-form-item field="ultimatelyBuyer" label="最终买家" label-col-flex="110px">

                          <a-select popup-container="html" class="bacClass" :loading="loading"
                                    :allowClear="true" @search="customNameSear"
                                    v-model="form.a.ultimatelyBuyer" :filter-option="false" allow-search
                                    style="width:270px;" :trigger-props="{ autoFitPopupMinWidth: true }"
                                    @focus="customNameFun" @chenge="orderCodeFun">
                            <a-option v-for="item in pageDataList" :label="item['customName']"
                                      :value="item['customName']">{{
                                item['customName']
                              }}
                            </a-option>
                          </a-select>

                        </a-form-item>
                      </a-col>

                      <a-col :span="8">
                        <a-form-item field="marketType" label="面料销售类型" label-col-flex="110px">
                          <!-- <a-select popup-container="html"  :style="{ width: '270px' }" v-model="form.a.marketType" allow-clear
                                                  @focus="orderNatureFun('面料销售类型')">
                                                  <a-option v-for="item of basicData.plusMaterial" :value="item.id"
                                                      :key="item.id" :label="item.plusMaterial" />
                                              </a-select> -->
                          <a-select popup-container="html" class="bacClass"
                                    :style="{ width: '270px' }" v-model="form.a.marketType"
                                    style="width:270px">
                            <a-option value="ok">米</a-option>
                            <a-option value="Y1">码</a-option>
                            <a-option value="Y2">公斤</a-option>
                            <a-option value="Y3">磅数</a-option>
                          </a-select>
                        </a-form-item>
                      </a-col>

                      <a-col :span="8">
                        <a-form-item field="exchangeCalorieClassify" label="流转卡类型"
                                     label-col-flex="110px" :validate-trigger="['change', 'blur']"
                                     :rules="[{ required: true, message: '流转卡类型' }]">
                          <!-- <a-select popup-container="html"  :style="{ width: '270px' }" v-model="form.a.labelFormatCode" allow-clear>
                                      <a-option v-for="item of basicData.labelFormat" :value="item.id" :key="item.id"
                                          :label="item.labelFormat" />
                                  </a-select> -->

                          <a-select popup-container="html" class="bacClass" :loading="loading"
                                    :allowClear="true" @search="exchangeCalorieClassifySear"
                                    v-model="form.a.exchangeCalorieClassify" :filter-option="false"
                                    allow-search style="width:270px;"
                                    :trigger-props="{ autoFitPopupMinWidth: true }" @change="selectChange"
                                    @focus="exchangeCalorieClassifyFun">
                            <a-option v-for="item in pageDataList"
                                      :label="item['exchangeCalorieClassify']"
                                      :value="item['exchangeCalorieClassify']">{{
                                item['exchangeCalorieClassify']
                              }}
                            </a-option>
                          </a-select>
                        </a-form-item>
                      </a-col>

                      <a-col :span="24">
                        <a-form-item field="remark" label="布号备注" label-col-flex="110px">
                          <!-- <a-input v-model="form.a.customOrderName" style="width:270px" /> -->
                          <a-input class="bacClass" v-model="form.a.remark" :rows="1" type="textarea"
                                   style="width:810px"/>
                        </a-form-item>
                      </a-col>


                      <a-col :span="8">
                        <a-form-item field="hqCraft" label="总部工艺" label-col-flex="110px">
                          <!-- <a-select popup-container="html"  :style="{ width: '310px' }" v-model="form.a.hqCraft" allow-clear>
                                                  <a-option v-for="item of basicData.plusMaterial" :value="item.id"
                                                      :key="item.id" :label="item.plusMaterial" />
                                              </a-select> -->
                          <a-input class="bacClass" v-model="form.a.hqCraft"/>
                        </a-form-item>
                      </a-col>

                      <a-col :span="16">
                        <a-form-item field="pack" label="包装要求" label-col-flex="110px">
                          <a-input class="bacClass" v-model="basicData.pack" style="width:150px"/>
                          <a-input class="bacClass" v-model="basicData.packA"
                                   style="width:160px; margin-left: 10px;"/>
                          <a-input class="bacClass" v-model="basicData.packB"
                                   style="width:160px; margin-left: 10px;"/>
                        </a-form-item>
                      </a-col>


                    </a-row>
                  </a-form>
                </div>
              </el-col>
              <el-col :span="6">
                <div class="grid-content ep-bg-purple-light">
                  <div style="width: 100%; height: 300px; padding-right: 5px; padding-left:5px">
                    <a-form :model="form.a" :disabled="objectOP.letmap1 == 2">
                      <a-row>
                        <a-col :span="23">
                          <a-form-item field="clientDyeCode" label="客户要求" label-col-flex="80px">
                          </a-form-item>
                        </a-col>
                      </a-row>
                      <!-- <AgGridVuesCopys style="height:345px;" class="ag-theme-alpine" :columnDefs="askList"
                                          :rowData="form.a.requirement" :defaultColDef="defaultColDefTc"
                                          rowSelection="multiple">
                                      </AgGridVuesCopys> -->
                      <a-textarea :disabled="objectOP.letmap1 == 2" v-model="form.a.require"
                                  default-value="" :auto-size="{
                                                minRows: 15,
                                                maxRows: 15
                                            }"
                                  style="margin-top: 0px;height: 250px;background-color: #fff;border: 1px solid #ccc;"/>
                    </a-form>
                  </div>
                </div>
              </el-col>
              <el-col :span="5">
                <div class="grid-content ep-bg-purple">
                  <div style="height: 300px; width: 100%;">
                    <a-form :model="shrink" :disabled="objectOP.letmap1 == 2">
                      <a-row>
                        <a-col :span="23">
                          <a-form-item field="clientDyeCode" label="缩水要求" label-col-flex="80px">
                            <a-input v-model="shrink.w" style="width:270px">
                              <template #prepend>
                                W
                              </template>
                            </a-input>
                            <a-input v-model="shrink.l" style="width:270px; margin-left:10px;">
                              <template #prepend>
                                L
                              </template>
                            </a-input>
                          </a-form-item>
                        </a-col>
                      </a-row>
                      <AgGridVuesCopys style="height:250px;" class="ag-theme-alpine" :columnDefs="testAsk"
                                       :rowData="testAskList.list" :defaultColDef="defaultColDef"
                                       rowSelection="multiple" :localeText="localeText1">
                      </AgGridVuesCopys>
                    </a-form>


                  </div>


                </div>
              </el-col>
            </el-row>
          </div>

          <div class="my-divisders">
            <a-divider orientation="center">
              <icon-double-up v-if="headerShow" @click="headerShow = false" :strokeWidth="2" :size="18"/>
              <icon-double-down v-else @click="headerShow = true" :strokeWidth="2" :size="18"/>
            </a-divider>
          </div>
        </div>

        <!-- <div style="padding:10px"></div> -->
        <div ref="tablediv" style="padding: 10px; box-sizing: border-box;min-height:100%;background-color: #fff;">
          <a-tabs   :lazy-load="true" default-active-key="2" @change="guanxi">
            <a-tab-pane key="2" title="订单明细列表11">
              <div style="height:5px;"></div>

              <AgGridVuesCopys style="height:340px" class="ag-theme-alpine" :columnDefs="tco"
                               :rowData="form.a.planOrderDetails" :defaultColDef="defaultColDefTc"
                               :enableColResize="true"
                               rowSelection="multiple" @grid-ready="gridReadyeB" :localeText="localeText1"
                               :disabled="objectOP.letmap1 == 2">
              </AgGridVuesCopys>
            </a-tab-pane>
            <a-tab-pane key="1" title='总部坯布信息'>
              <div class="my-tool-bar">
                <a-button type="primary" @click="countBu">查询</a-button>
              </div>
              <div style="height:15px;"></div>
              <!-- <a-table :columns="total" :data="form.a.planOderGreys" /> -->
              <AgGridVuesCopys style="height:300px;" class="ag-theme-alpine" :columnDefs="total"
                               :rowData="planOderGreys" :defaultColDef="defaultColDefTc" rowSelection="multiple"
                               :localeText="localeText1">
              </AgGridVuesCopys>
            </a-tab-pane>
          </a-tabs>
        </div>
        <a-drawer :drawer-style="{ 'zIndex': 9999 }" placement="bottom" :mask-closable="false" width="100" height="100%"
                  :visible="objectOP.importAdd" unmountOnClose @ok="sideaOk" @cancel="sideaNo" cancel-text='关闭'
                  :ok-text="mobanYnKey == 1 ? '保存' : '退至可用数据'">

          <template #title>
            <div style="position: absolute; right: 50px;">
              <!-- <Toolbar :items="['查询 ', '确定', 'Excel资料导入', '导出']" @add="addHandler" @import="importHandler"
                          @del="deleteHandler" @select="selectHandler" @export="exports" @excel="downloadHandler">
                      </Toolbar> -->
              <el-button plain :icon="Search" @click="guanxiCount">查询</el-button>
              <!-- <el-button plain @click="yesOrder">确定</el-button> -->
              <el-button plain :icon="CirclePlus" @click="downloadHandler">模板下载</el-button>
              <el-button plain :icon="CirclePlus" @click="importHandler">导入</el-button>
            </div>

            <div class="my-tool-bar">
              台巨客户
              <!-- <el-button type="primary" :icon="CirclePlus" class="stbutencx"
                          @click="importHandler">导入后台巨客户</el-button> -->
              <!-- <el-button type="primary" :icon="CirclePlus" class="stbutencx"
                          @click="importHandler">导入后台巨客户按钮</el-button> -->
              <!-- <el-button type="primary" :icon="CirclePlus" class="stbutencx" @click="downloadHandler">模板下载</el-button>
                      <el-button type="primary" :icon="CirclePlus" class="stbutencx" @click="yesOrder">确定</el-button> -->
            </div>
          </template>
          <div>
            <a-form :model="guanxiForm">
              <a-row :gutter="16">
                <a-col :span="4">
                  <a-form-item label="客户订单号:" label-col-flex="100px">
                    <a-input class="bacClass" v-model="guanxiForm.customOrderCode"/>
                  </a-form-item>
                </a-col>
                <a-col :span="4">
                  <a-form-item field="clothCode" label="布号:" label-col-flex="100px">
                    <!-- <el-select v-model="guanxiForm.clothCode" filterable @click="selectChange">
                                      <el-option v-for="item in optionsList" :key="item.id" :label="item.clothCode"
                                          :value="item.clothCode" />
                                  </el-select> -->
                    <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                              @search="clothCodeSearch" v-model="guanxiForm.clothCode" :filter-option="false"
                              allow-search @focus="clothCodeBoSel" style="width:270px;"
                              :trigger-props="{ autoFitPopupMinWidth: true }" @change="clothChanges">
                      <a-option v-for="item in optionsList" :label="item['clothCode']"
                                :value="item['clothCode']">{{
                          item['clothCode'] + '——' + item['brandName']
                        }}
                      </a-option>
                    </a-select>


                  </a-form-item>
                </a-col>
                <a-col :span="4">
                  <a-form-item field="productName" label="品名" label-col-flex="100px">
                    <!-- <el-select v-model="guanxiForm.productName" filterable @click="selectPin">
                                      <el-option v-for="item in pinList" :key="item.id" :label="item.brandName"
                                          :value="item.brandName" />
                                  </el-select> -->
                    <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                              @search="clothCodeSearchA" v-model="guanxiForm.productName" :filter-option="false"
                              allow-search @focus="clothCodeBoSelA" style="width:270px;"
                              :trigger-props="{ autoFitPopupMinWidth: true }" @change="clothChangess">
                      <a-option v-for="item in pinList" :label="item['brandName']"
                                :value="item['brandName']">{{
                          item['brandName'] + '————' + item['clothCode']
                        }}
                      </a-option>
                    </a-select>

                  </a-form-item>
                </a-col>
                <a-col :span="4">
                  <a-form-item field="colorCode" label="色号" label-col-flex="100px">
                    <a-input class="bacClass" v-model="guanxiForm.colorCode"/>
                  </a-form-item>
                </a-col>
                <a-col :span="4">
                  <a-form-item field="colorName" label="色称" label-col-flex="100px">
                    <a-input class="bacClass" v-model="guanxiForm.colorName"/>
                  </a-form-item>
                </a-col>
              </a-row>
            </a-form>
          </div>
          <div style="height:15px;"></div>
          <a href="#" style="color:blue">订单明细列表</a>
          <div style="height:10px;"></div>

          <a-tabs   :lazy-load="true" :default-active-key="1" @change="mobanYn">
            <a-tab-pane :key="1" title="可用数据">
              <AgGridVuesCopys :rowHeight="33" :headerHeight="33" style="height:72vh;" class="ag-theme-alpine"
                               :columnDefs="hugeCustomer" :rowData="orderCustomList.list"
                               :defaultColDef="defaultColDefBc"
                               rowSelection="multiple" @grid-ready="gridReadyB" :suppressCopyRowsToClipboard="true"
                               :localeText="localeText1">
              </AgGridVuesCopys>
            </a-tab-pane>
            <a-tab-pane :key="2" title="已用数据">
              <AgGridVuesCopys :rowHeight="33" :headerHeight="33" style="height:72vh;" class="ag-theme-alpine"
                               :columnDefs="hugeCustomer" :rowData="orderCustomList.list"
                               :defaultColDef="defaultColDefBc"
                               rowSelection="multiple" @grid-ready="gridReadyC" :localeText="localeText1">
              </AgGridVuesCopys>
            </a-tab-pane>
          </a-tabs>
        </a-drawer>
      </div>
    </a-drawer>


    <!-- 交期、缸型、车间 -->

    <a-drawer :drawer-style="{ 'zIndex': 9999 }" placement="bottom" :mask-closable="false" height="100%"
              :visible="pageData.bulkVisible" unmountOnClose @ok="bulkOK" @cancel="pageData.bulkVisible = false"
              cancel-text='关闭'
              ok-text="保存">
      <template #title>
        {{ pageData.sideTitle }}
      </template>
      <div>
        <a-form-item v-if="pageData.sideTitle == '交期修改'" :label-col-flex="pageData.labelColFlex" label="交货日期">
          <a-date-picker class="bacClass" v-model="pageData.deliveryTime" style="width: 250px;"
                         @change="listChange()"/>
        </a-form-item>
        <a-form-item v-if="pageData.sideTitle == '指定缸型'" label="缸型">
          <a-select class="bacClass" v-model="pageData.cylinderTypes" allow-search allow-clear @change="listChange()"
                    style="width:250px">
            <a-option value="E缸">E缸</a-option>
            <a-option value="S缸">S缸</a-option>
          </a-select>
        </a-form-item>
        <a-form-item v-if="pageData.sideTitle == '指定车间'" label="染色车间">
          <a-select allow-search allow-clear class="bacClass" v-model="pageData.workshops" @change="listChange()"
                    style="width:250px">
            <a-option value="染部A">染部A</a-option>
            <a-option value="染部B">染部B</a-option>
          </a-select>
        </a-form-item>
        <AgGridVuesCopys :rowHeight="33" :headerHeight="33" style="height:500px" :suppressCopyRowsToClipboard="true"
                         rowSelection="multiple" @grid-ready="gridReadyXG" :defaultColDef="defaultColDef"
                         class='ag-theme-alpine'
                         :rowData="pageData.bulkList" :columnDefs="pageData.columnDefs" :localeText="localeText1">
        </AgGridVuesCopys>
      </div>
    </a-drawer>
  </pageTabelLayout>
</template>

<script lang="ts">
import pageTabelLayout from "@/components/pageTabelLayout.vue";
import {post, get} from "@/api/http";
import {Search, CirclePlus, Delete, EditPen} from "@element-plus/icons-vue";
// import {
//     useTable,
//     useRowKey,
//     useTableColumn,
//     usePagination,
//     useRowSelection,
// } from "@/hooks/table";
import {FormInstance} from "@arco-design/web-vue/es/form";
import textClothRequires from '@/views/Aps/planOrderA/selectList/textClothRequires.vue'
import {useRouter} from 'vue-router';
import {ref, reactive, onMounted, onActivated, onUnmounted, watch, nextTick} from "vue";
// import Toolbar from "@/components/Toolbar.vue";
import {Form, Message, Modal, Pagination} from "@arco-design/web-vue";
import cheCkFirstRate from '@/views/Aps/planOrderA/cheCkBoxComm/cheCkFirstRate.vue'             //一等品
import cheCkBumpWhite from '@/views/Aps/planOrderA/cheCkBoxComm/cheCkBumpWhite.vue'             //撞白
import cheCkwetRubbing from '@/views/Aps/planOrderA/cheCkBoxComm/cheCkwetRubbing.vue'           //问擦提升
import cheCkChlorineResistant from '@/views/Aps/planOrderA/cheCkBoxComm/cheCkChlorineResistant.vue'           //耐氯提升
import {localeText} from '@/api/aggridZw'
import cheCkstainResistance from '@/views/Aps/planOrderA/cheCkBoxComm/cheCkstainResistance.vue'//白色防沾处理
import cheCkrcInfo from '@/views/Aps/planOrderA/cheCkBoxComm/cheCkrcInfo.vue'                   // 白色RC处理
import cheCkResistanceYellow from '@/views/Aps/planOrderA/cheCkBoxComm/cheCkResistanceYellow.vue'                   // 抗黄处理
import CheCkdialPrinting from '@/views/Aps/planOrderA/cheCkBoxComm/CheCkdialPrinting.vue'       //拔印
import cheCkrepeatPack from '@/views/Aps/planOrderA/cheCkBoxComm/cheCkrepeatPack.vue'           //重打包
import cheCKneedEnterPot from '@/views/Aps/planOrderA/cheCkBoxComm/cheCKneedEnterPot.vue'       //需进缸
import cheCkhyperthermiaWhite from '@/views/Aps/planOrderA/cheCkBoxComm/cheCkhyperthermiaWhite.vue'       //高温定坯除白胶草
import cheCktakeDyeFee from '@/views/Aps/planOrderA/cheCkBoxComm/cheCktakeDyeFee.vue'           //收取染费
import emitter from "@/hooks/useEventBus";
import planAddInx from './planOrderXin/index.vue'
import axios from "axios";
import Toolbar from "@/components/Toolbar.vue";

import filedownload from 'js-file-download';
import tagRender from '@/components/SelectRenderer.vue'
import cheCk from '@/views/Aps/planOrderA/cheCkBoxComm/cheCk.vue'                               //快反需求
import checheCkEdgeCK from '@/views/Aps/planOrderA/cheCkBoxComm/cheCkEdge.vue'                  //珠地边
import cheCKStaining from '@/views/Aps/planOrderA/cheCkBoxComm/cheCKStaining.vue'
import selectGreyCode from '@/views/Aps/planOrderA/selectList/selectGreyCode.vue'           //问擦提升
import selectGreyName from '@/views/Aps/planOrderA/selectList/selectGreyName.vue'           //问擦提升
import selectColorCode from '@/views/Aps/planOrderA/selectList/selectColorCode.vue'         //色号
import selectColorCodeZ from '@/views/Aps/planOrderA/selectList/selectColorCodeZ.vue'         //色号
import selectColorName from '@/views/Aps/planOrderA/selectList/selectColorName.vue'         //色称
import selectColorNameZ from '@/views/Aps/planOrderA/selectList/selectColorNameZ.vue'
import selectCylinder from '@/views/Aps/planOrderA/selectList/selectCylinder.vue'
import selectAffirmColor from '@/views/Aps/planOrderA/selectList/selectAffirmColor.vue'
import selectGreyType from '@/views/Aps/planOrderA/selectList/selectGreyType.vue'
import selectTrimCharges from '@/views/Aps/planOrderA/selectList/selectTrimCharges.vue'
import selectDyeingType from '@/views/Aps/planOrderA/selectList/selectDyeingType.vue'
import selectColorDepth from '@/views/Aps/planOrderA/selectList/selectColorDepth.vue'
import selectWorkshop from '@/views/Aps/planOrderA/selectList/selectWorkshop.vue'
import selectOrdering from '@/views/Aps/planOrderA/selectList/selectOrdering.vue'
import selectFabricNumberZ from '@/views/Aps/planOrderA/selectList/selectFabricNumberZ.vue'
import selectProductionMode from '@/views/Aps/planOrderA/selectList/selectProductionMode.vue'
import selectMachinType from '@/views/Aps/planOrderA/selectList/selectMachinType.vue'
import selectSeason from '@/views/Aps/planOrderA/selectList/selectSeason.vue'
import selectTradeCode from '@/views/Aps/planOrderA/selectList/selectTradeCode.vue'
import "ag-grid-community/styles/ag-grid.css";
import "ag-grid-community/styles/ag-theme-alpine.css";
import {column} from 'element-plus/es/components/table-v2/src/common';
//import aag from "./AGbut"
//import aag from "./agbuut.vue"
interface ClothSet {
  id?: any;
  serialNumber?: number | undefined,
  mercery?: string | undefined;
  deleteState?: any
  remark?: string | undefined;
  productionMode?: string | undefined;
  createName?: string | undefined;
  createTime?: string | undefined;
  updateName?: string | undefined;
  updateTime?: string | undefined;
}

interface pagings {
  size: number | string,
  total: any,
}

export default {
  name: "productionMode",
  setup() {
    const headerShow = ref<boolean>(true)
    const pages = ref(1);
    const pageData = reactive<{
      clothList: ClothSet[]
      showAdd: boolean
      sideTitle: string
      dropDownData: any
      pageLoading: boolean,
      theight: number,
      tablediv: any,
      rHeight: number | undefined,
      importAdd: boolean,
      bulkVisible: boolean,
      deliveryTime: any,
      cylinderTypes: any,
      workshops: any,
      bulkList: any[],
      columnDefs: any[],
      deliveryStatus: any
    }>({
      clothList: [],
      showAdd: false,
      sideTitle: "新增计划订单",
      dropDownData: "",
      pageLoading: false,
      theight: 0,
      tablediv: null,
      rHeight: 0,
      importAdd: false,
      bulkVisible: false,
      deliveryTime: '',
      cylinderTypes: '',
      workshops: '',
      bulkList: [],
      columnDefs: [],
      deliveryStatus: null
    });
    const paging: pagings = reactive({
      size: 10,
      total: 30,
    })
    let shen = ref(0);
    const tableCon: any = reactive({
      tableConter: [],
    });
    const tableConA: any = reactive({
      tableConter: [],
    });

    let tc = [
      {
        showRowGroup: 'hide_def',
        "headerName": "",
        "checkboxSelection": true,
        "headerCheckboxSelection": true,
        "pinned": "left",
        "width": 50,
        resizable: false,
        filter: false,
        sortable: false,
        minWidth: 50,
        maxWidth: 50,
        lockPosition: "left",
      },
      {headerName: "订单号", field: "orderCode", width: 160},
      {
        headerName: "交货日期", field: "lastDeliveryTime", width: 160,
        cellRenderer: {
          template: `
            <div style="background-color:#55db53;" v-if="val.deliveryStatus == 1">{{ val.lastDeliveryTime }}</div>
            <div v-else>{{ val.lastDeliveryTime }}</div>`,
          setup(props: any) {
            let val = ref(props.params.data)
            return {
              val,
            }
          }
        },
      },
      {headerName: "下单日期", field: "authorizedStrengthTime", width: 160},
      {headerName: "下单部门", field: "placeDepartment", width: 160},
      {headerName: "染整单号", field: "clientDyeCode", width: 160},
      {headerName: "客户名称", field: "customName", width: 160},
      {headerName: "客订名称", field: "customOrderName", width: 160},
      {headerName: "布号", field: "clothCode", width: 160},
      {headerName: "品名", field: "productName", width: 160},
      {headerName: "色号", field: "colorCode", width: 160},
      {headerName: "确认色", field: "affirmColor", width: 160},
      {headerName: "色称", field: "colorName", width: 160},
      {headerName: "对色资料", field: "contrastColor", width: 160},
      {headerName: "匹数", field: "houseNum", width: 160},
      {headerName: "成品重量", field: "finishedWeight", width: 160},
      {headerName: "投染重量", field: "castDyeWeight", width: 160},
      {headerName: "总损耗", field: "allLoss", width: 160},
      {headerName: "订单性质", field: "orderNature", width: 160},
      {headerName: "布种类别", field: "greyType", width: 160},
      {headerName: "染色类型", field: "dyeingType", width: 160},
      {headerName: "缸型", field: "cylinderType", width: 160},


      {headerName: "生产车间", field: "workshop", width: 160},
      {headerName: "客户要求", field: "require", width: 160},


      {headerName: "总部工艺", field: "hqCraft", width: 160},
      // {
      //     headerName: '收费项',
      //     field: 'circulatCard',
      //     width: 160,
      //     children: [
      {headerName: "整理收费项目", field: "trimCharges", width: 160},
      {headerName: "合染类型", field: "joinDyeType", width: 160, cellRenderer: cheCKStaining},
      {headerName: "一等品", field: "firstRate", width: 160, cellRenderer: cheCkFirstRate},
      {headerName: "撞白", field: "bumpWhite", width: 160, cellRenderer: cheCkBumpWhite},
      {headerName: "湿擦提升", field: "wetRubbing", width: 160, cellRenderer: cheCkwetRubbing},
      {headerName: "耐氯提升", field: "chlorineResistant", width: 160, cellRenderer: cheCkChlorineResistant},
      {headerName: "白色防沾处理", field: "stainResistance", width: 160, cellRenderer: cheCkstainResistance},
      {headerName: "白色RC处理", field: "rcInfo", width: 160, cellRenderer: cheCkrcInfo},
      {headerName: "抗黄处理", field: "resistanceYellow", width: 160, cellRenderer: cheCkResistanceYellow},
      {headerName: "拔印", field: "dialPrinting", width: 160, cellRenderer: CheCkdialPrinting},
      {headerName: "重打包", field: "repeatPack", width: 160, cellRenderer: cheCkrepeatPack},
      {headerName: "需进缸", field: "needEnterPot", width: 160, cellRenderer: cheCKneedEnterPot},
      {headerName: "高温定坯除白胶草", field: "hyperthermiaWhite", width: 160, cellRenderer: cheCkhyperthermiaWhite},
      {headerName: "收取染费", field: "takeDyeFee", width: 160, cellRenderer: cheCktakeDyeFee},
      //     ]
      // },
      {headerName: "门幅", field: "efficacious", width: 160},
      {headerName: "克重", field: "gramWeight", width: 160},


      // {
      //     headerName: '总部',
      //     field: 'circulatCard',
      //     width: 600,
      //     children: [
      {headerName: "商品号", field: "tradeCode", width: 160},
      {headerName: "商品名称", field: "tradeName", width: 160},
      {headerName: "成品布号", field: "finishedClothCode", width: 160},
      {headerName: "成品名称", field: "finishedClothName", width: 160},
      {headerName: "商品门幅", field: "tradeEfficacious", width: 160},
      {headerName: "商品克重", field: "tradeGramWeight", width: 160},
      {headerName: "商品色号", field: "tradeColorCode", width: 160},
      {headerName: "商品色称", field: "tradeColorName", width: 160},
      //     ]
      // },


      // {
      //     headerName: '生产状态',
      //     field: 'circulatCard',
      //     width: 600,
      //     children: [
      {headerName: "存坯条数", field: "repertoryNum", width: 160},
      {headerName: "欠坯条数", field: "oweRepertoryNum", width: 160},
      {headerName: "已开单条数", field: "createOrderNum", width: 160},
      {headerName: "欠开单条数", field: "oweCreateOrderNum", width: 160},
      {headerName: "已染色条数", field: "deyNum", width: 160},
      {headerName: "欠染色条数", field: "oweDeyNum", width: 160},
      {headerName: "已批核条数", field: "auditNum", width: 160},
      {headerName: "欠批核条数", field: "oweAuditNum", width: 160},
      {headerName: "已出货条数", field: "outNum", width: 160},
      {headerName: "未出货条数", field: "oweOutNum", width: 160},
      {headerName: "HOLD单条数", field: "holdNum", width: 160},
      //     ]
      // },

      // {
      //     headerName: '重点工序',
      //     field: 'circulatCard',
      //     width: 600,
      //     children: [
      {headerName: "定坯", field: "orientStock", width: 160},
      {headerName: "烧毛", field: "singeing", width: 160},
      {headerName: "长车", field: "longVehicle", width: 160},
      {headerName: "拉针机", field: "needleDrawing", width: 160},
      {headerName: "预缩机", field: "preShrinking", width: 160},
      {headerName: "抓毛机", field: "combing", width: 160},
      {headerName: "梳剪联机", field: "thinningShearing", width: 160},
      {headerName: "摇粒机", field: "polarFleece", width: 160},
      //     ]
      // },
      {headerName: "客户布号", field: "customClothCode", width: 160},
      {headerName: "客户品名", field: "customProductName", width: 160},
      {headerName: "客户色号", field: "customColorCode", width: 160},
      {headerName: "客户色称", field: "customColorName", width: 160},
      {headerName: "客户PO号", field: "customPo", width: 160},
      {headerName: "客户订单号", field: "customOrderCode", width: 160},
      {headerName: "款号", field: "styleNumber", width: 160},
      {headerName: "最终买家", field: "ultimatelyBuyer", width: 160},
      {headerName: "季节", field: "season", width: 160},
      {headerName: "成分", field: "ingredient", width: 160},
      {headerName: "标签类型", field: "labelFormatCode", width: 160},
      {headerName: "测试标准", field: "testCriterion", width: 160},
      {headerName: "对色光源", field: "coloringIlluminant", width: 160},
      {headerName: "敏感色", field: "sensitiveColor", width: 160},
      {headerName: "颜色深浅", field: "colorDepth", width: 160},
      {headerName: "送货地址", field: "deliveryAddress", width: 160},
      {headerName: "纸筒", field: "paperTube", width: 160},
      {headerName: "加重", field: "aggravate", width: 160},
      {headerName: "定型剪办要求", field: "finalize", width: 160},
      {headerName: "质检剪办要求", field: "quality", width: 160},
      {headerName: "门幅上限", field: "upperLimit", width: 160},
      {headerName: "门幅下限", field: "lowerLimit", width: 160},
      {headerName: "克重上限", field: "gramUpperLimit", width: 160},
      {headerName: "克重下限", field: "gramLowerLimit", width: 160},
      {headerName: "坯布编号", field: "greyCode", width: 160},
      {headerName: "坯布名称", field: "greyName", width: 160},
      {headerName: "坯布深浅", field: "greyColorDepth", width: 160},
      {headerName: "珠地边", field: "edge", width: 160},


      // {
      //     headerName: '回修',
      //     field: 'circulatCard',
      //     width: 600,
      //     children: [
      {headerName: "缸号", field: "repairMachineCode", width: 160},
      {headerName: "布号", field: "repairClothCode", width: 160},
      {headerName: "布称", field: "repairProductName", width: 160},
      {headerName: "色号", field: "repairColorCode", width: 160},
      {headerName: "色称", field: "repairColorName", width: 160},
      //     ]
      // },
      // {
      //     headerName: '台巨 ',
      //     field: 'circulatCard',
      //     width: 600,
      //     children: [
      {headerName: "Prod Id", field: "prodId", width: 160},
      {headerName: "Seq No", field: "seqNo", width: 160},
      {headerName: "SHIPTO地址", field: "shiptoSite", width: 160},
      //     ]
      // },
      {
        headerName: "状态", field: "detailAuditState", width: 120,
        pinned: 'right',
        cellRenderer: {
          template: `
            <el-tag type="warning" class="gesture" v-if="e == 0">待审核</el-tag>
            <el-tag type="success" class="gesture" v-if="e == 1">已审核</el-tag>
          `,
          setup(props: any) {
            return {
              e: props.params.data.detailAuditState
            }
          }
        }
      },
      {
        headerName: "操作", field: "action", width: 150, pinned: 'right', cellRenderer: {
          template: `
            <a-space>
              <el-button style="color:#165dff;" @click="a" class="gesture" v-if="e == 0" link>修改</el-button>
              <el-button link style="color:#165dff;" @click="b" class="gesture">详情</el-button>
            </a-space>`,
          setup(props: any) {
            const a = () => {
              editHandler(props.params.data)
            }
            const b = () => {
              editHandler1(props.params.data)
            }
            return {
              a, b, e: props.params.data.detailAuditState
            }
          }
        }
      },
    ]

    const defaultColDef = {
      sortable: true,
      filter: true,
      //  flex: 1,
      resizable: true,
    };
    //查询表单
    const fromList: any = reactive({
      page: 1,
      size: 10,
      autStartTime: '',
      autEndTime: '',
      clientDyeCode: "",
      customName: '',
      finishedClothCode: '',
      colorCode: '',
      colorName: '',
      delStartTime: '',
      delEndTime: "",
      customOrderCode: "",
      customOrderName: '',
      greyCode: '',
      orderNature: '',
      placeDepartment: '',
      auditState: '',
      craftState: '',
      openOrderState: '',
      cards: [],


    })

    //下拉框
    const basicData = reactive({
      dictTypeList: ['订单性质', '结算方式', '面料销售类型', '结算公司'],
      ProductionMode: [],
      machinType: [],
      ExchangecalorieClassify: [],
      saleType: [],
      labelFormat: [],
      UrgentCategory: [],

      orderNature: [],
      Calculation: [],
      plusMaterial: [],
      corporation: [],
      custom: [],
      hrEmployee: [],
      baCompany: [],
      VerifyStandard: [],
      coloringMatch: [],
      seasonSet: [],
      dyeingList: [],              //染整单号下拉框


      serialNo: 0,
      pack: '',
      packA: '',
      packB: '',
    })
    /************************************************************查询************************************************************************************/
        //查询
    const selectHandler = () => {
          pages.value = 1;
          doRefresh(shen.value);
        }

    function doRefresh(data: any) {
      pageData.pageLoading = true
      fromList.auditState = data
      // console.log(fromList)
      post({
        url: "/aps/planOrder/getDetailPage",
        data: fromList
      }).then(({data, code}: any) => {
        if (code === 200) {
          //  console.log(data, "结果");
          tableCon.tableConter = data.data;
          tableConA.tableConter = data.data;
          paging.total = data.total;
          //     // pagination.setTotalSize(data.total);

        }
      })
          .catch(console.log).finally(() => {
        pageData.pageLoading = false
      })
    }

    /***************************************************删除***************************************************************************** */
    const trigger = ref('1');
    const gridOption = ref();
    const gridReady = (params: any) => {
      gridOption.value = params.api
    }
    const gridOptionA = ref()
    const gridReadyA = (params: any) => {
      gridOptionA.value = params.api
    }
    const deleteHandler = () => {
      var arr: any = [];
      if (trigger.value == '1') {
        if (shen.value == 0) {
          arr = gridOption.value.getSelectedRows().map((item: any) => {
            return item.detail1Id
          })
        } else {
          arr = gridOptionA.value.getSelectedRows().map((item: any) => {
            return item.detail1Id
          })
        }
      } else {
        if (shen.value == 0) {
          arr = gridOption.value.getSelectedRows().map((item: any) => {
            return item.detail1Id
          })
        } else {
          arr = gridOptionA.value.getSelectedRows().map((item: any) => {
            return item.detail1Id
          })
        }
      }

      //console.log(gridOption.value.getSelectedRows(), "lkj");
      if (arr.length === 0) {
        Message.warning({
          content: "请选择要删除的数据",
          duration: 5000,
        });
        return;
      }
      // console.log(arrs);
      Modal.confirm({
        title: "系统提示",
        content: "确认删除选中的数据?",
        onOk() {
          post({
            url: "aps/planOrder/delete",
            data: arr,
          }).then(({code, data, message}: any) => {
            // console.log(code,"删除的状态码")
            if (code === 200) {
              Message.success({
                content: "删除成功",
                duration: 5000,
              });
              doRefresh(shen.value)
              pages.value = 1;
            } else {
              Message.error({
                content: message,
                duration: 5000,
              });
            }
          });
        },
      });
    };

    /*************************************************修改***********************************************************************************/
    const editHandler = (record: any) => {
      // initCum();
      //详情
      // 新增为0，修改为1，详情为2
      objectOP.letmap1 = 1
      pageData.deliveryStatus = record.deliveryStatus
      console.log(pageData.deliveryStatus);

      // let newBoolMap2 = '修改资料'
      // emitter.emit('inOne', newBoolMap);
      pageData.sideTitle = '修改计划订单'
      Tchoocl.showAdd = true
      post({
        url: "aps/planOrder/getSaveInfo",
        data: {orderCode: record.orderCode}
      }).then(({data, code}: any) => {
        if (code === 200) {
          for (var key in data) {
            form.a[key] = data[key]
          }
          form.a.planOrderDetails = data.detail
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    };
    const agCellClicks = () => {
      if (shen.value == 0) {
        editHandler1(gridOption.value.getSelectedRows()[0])
      } else {
        editHandler1(gridOptionA.value.getSelectedRows()[0])
      }

    }
    //详情
    const editHandler1 = (record: any) => {
      // initCum();
      //详情
      // 新增为0，修改为1，详情为2
      objectOP.letmap1 = 2
      let newBoolMap2 = '2'
      emitter.emit('inOne', newBoolMap2);
      pageData.sideTitle = '计划订单详情'
      Tchoocl.showAdd = true
      post({
        url: "aps/planOrder/getSaveInfo",
        data: {orderCode: record.orderCode}
      }).then(({data, code}: any) => {
        if (code === 200) {
          for (var key in data) {
            form.a[key] = data[key]
          }
          form.a.planOrderDetails = data.detail
          form.a.planOrderDetails.forEach((item: any) => {
            return item.letBoolNum = 2
          })
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    };

    /**************************************************审核******************************************************************************** */
    //审核
    function changeGetS(auditState: Number) {
      var arr = [];
      let s = ''
      if (trigger.value == '1') {
        if (auditState == 1) {
          arr = gridOption.value.getSelectedRows().map((item: any) => {
            s = "确认审核选中的数据?"
            return item.detail1Id
          })
        } else {
          arr = gridOptionA.value.getSelectedRows().map((item: any) => {
            s = "确认反审选中的数据?"
            return item.detail1Id
          })
        }
      } else {
        if (auditState == 1) {
          arr = gridOption.value.getSelectedRows().map((item: any) => {
            s = "确认审核选中的数据?"
            return item.detail1Id
          })
        } else {
          arr = gridOptionA.value.getSelectedRows().map((item: any) => {
            s = "确认反审选中的数据?"
            return item.detail1Id
          })
        }

      }
      if (arr.length > 0) {
        let dataA: any = []
        dataA = arr.map((item: any) => {
          return {detail1Id: item, auditState: auditState}
        })
        Modal.confirm({
          title: "系统提示",
          content: s,
          onOk() {
            post({
              url: "/aps/planOrder/audit",
              data: dataA,
            }).then(({code, data, message}: any) => {
              // console.log(code,"删除的状态码")
              if (code === 200) {
                Message.success({
                  content: "审核成功",
                  duration: 5000,
                });
                pages.value = 1;
                if (dataA[0].auditState == 1) {
                  doRefresh(0);
                } else {
                  doRefresh(1);
                }
              } else {
                // selectHandler()
                Message.error({
                  content: message,
                  duration: 5000,
                });
              }
            });
          },
        });
      } else {
        Message.warning({
          content: "请选择要审核的数据",
          duration: 5000,
        });
        return;
      }
    }

    /*************************************************新增************************************************************************************ */
    const router = useRouter()
    const addHandler = () => {
      for (var key in form.a) {
        if (key === 'planOrderDetails' || key === 'planOrderTest' || key === 'requirement') {
          form.a.planOrderDetails = []
          form.a.planOrderTest = []
          form.a.requirement = []
        } else {
          form.a[key] = ''
        }

      }
      // console.log(form.a)
      // form.a.planOrderDetails = []
      objectOP.letmap1 = 0
      Tchoocl.showAdd = true
      pageData.sideTitle = '新增计划订单'
      // router.push('/productmasterdata/order/planOrderXin/index')
    }

    /************************************************待处理/已处理页签*******************************************************************************************/
    function changeGet(key: any) {
      trigger.value = key
      console.log(key)
      if (key == 0) {
        shen.value = 0
        doRefresh(shen.value)
      } else {
        shen.value = 1
        doRefresh(shen.value)
      }
    };
    /************************************************分页***********************************************************************************************/
        //页改变
    const pagingChange = (current: number) => {
          // console.log(current, "分页改变");
          fromList.page = current;
          // console.log(current)
          doRefresh(shen.value);
        }
    //页条改变
    const pagingSizeChange = (pageSize: number) => {
      //  console.log(pageSize, "条数")
      fromList.size = pageSize
      pages.value = 1;
      paging.size = pageSize;
      doRefresh(shen.value);
    }

    /****************************************************选择日期********************************************************************************************** */
    function onSelect(dateString: any, date: any) {
      console.log('onSelect1', dateString, date);
    }

    function onChange(dateString: any, date: any) {
      console.log('onChange2: ', dateString, date);
      if (dateString == undefined) {
        fromList.autStartTime = ''
        fromList.autEndTime = ''
      } else {
        fromList.autStartTime = dateString[0]
        fromList.autEndTime = dateString[1]
      }
    }

    function onSelect1(dateString: any, date: any) {
      console.log('onSelect3', dateString, date);
    }

    function onChange1(dateString: any, date: any) {
      console.log('onChange4: ', dateString, date);
      if (dateString == undefined) {
        fromList.delStartTime = ''
        fromList.delEndTime = ''
      } else {
        fromList.delStartTime = dateString[0]
        fromList.delEndTime = dateString[1]
      }
    }

    /******************************************************染整单号.客户名称.客户订单号.客订名称.订单性质下拉选查询************************************ */
        //下拉框得到焦点
    let pan = 0
    const focusSel = (value: any) => {
      let obj = {}
      switch (value) {
        case 1:
          obj = {clientDyeCode: ""}
          pan = 1
          break;
        case 2:
          obj = {customName: ''}
          pan = 2
          break;
        case 3:
          obj = {customOrderCode: ''}
          pan = 3
          break;
        case 4:
          obj = {customOrderName: ''}
          pan = 4
          break;
        case 5:
          obj = {orderNature: ''}
          pan = 5
          break;
        case 6:
          obj = {placeDepartment: ''}
          pan = 6
          break;
      }
      selCxAll(obj)
    }
    //下拉数据
    let pageDataList = ref([])
    let options = ref<any>(pageDataList.value);
    let loading = ref(false);
    const handleSearch = (value: any) => {
      let ob = {}
      switch (pan) {
        case 1:
          ob = {clientDyeCode: value}
          break;
        case 2:
          ob = {customName: value}
          break;
        case 3:
          ob = {customOrderCode: value}
          break;
        case 4:
          ob = {customOrderName: value}
          break;
        case 5:
          ob = {orderNature: value}
          break;
      }

      loading.value = true;
      if (pan == 3) {
        selCxAll1(ob)
      } else {
        selCxAll(ob);
      }
      options.value = pageDataList.value;
      loading.value = false;
    };

    //下拉框查询
    function selCxAll(val: any) {
      post({
        url: "/aps/custom/getDropValue",
        data: val
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageDataList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });

    };

    function selCxAll1(val: any) {
      post({
        url: "/aps/planOrder/getDropValue",
        data: val
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageDataList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });

    };

    let selectChange = () => {
    };

    /******************************************************成品布号下拉选查询*************************************************************** */
    const focusSelBh = () => {
      setCxAllBh({clothCode: ''})
    };
    const handleSearchBh = (value: any) => {
      let ob = {clothCode: value}
      loading.value = true;
      setCxAllBh(ob)
      options.value = pageDataList.value;
      loading.value = false;
    };

    function setCxAllBh(val: any) {
      post({
        url: "/pdm/DevFabricInfo/getLikeList",
        data: val
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageDataList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    }

    /******************************************************色号.色称.坯布编号下拉选查询************************************************************* */
    const focusSelSh = (val: any) => {
      let ob = {}
      switch (val) {
        case 1:
          ob = {colorCode: ''}
          break;
        case 2:
          ob = {colorName: ''}
          break;
        case 3:
          ob = {}
          break;
      }
      setCxAllSH(ob)

    };
    const handleSearchSh = (value: any) => {
      let ob = {greyCode: value}
      loading.value = true;
      setCxAllSH(ob)
      options.value = pageDataList.value;
      loading.value = false;
    };

    function setCxAllSH(val: any) {
      post({
        url: "/aps/planOrder/getDropValue1",
        data: val
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageDataList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    }

    /******************************************************已下流转卡号************************************************************* */
    const focusSelLz = (val: any) => {
      setCxAllLz({flowCardCode: ''})
    };

    function setCxAllLz(val: any) {
      post({
        url: "/aps/circulatCard/getDropValue",
        data: val
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageDataList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    }

    const Tchoocl = reactive({
      showAdd: false,
      sideOk() {
        console.log(666)
      }
    })

    const greyCodeList = ref([])

    const pbbh = (val: any) => {
      post({
        url: "/aps/circulatCard/getDropValue",
        data: {
          greyCode: val
        }
      }).then(({data, code}: any) => {
        if (code === 200) {
          greyCodeList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    }

    const ddxzList = ref([])

    const ddxz = (val: any) => {
      post({
        url: 'dict/dictTypeDetail/getList',
        data: {
          codeType: 20,
          // detailName: val,
        },
      }).then(({code, data}: any) => {
        if (code == 200) {
          ddxzList.value = data
        } else {
          Message.error({
            content: '查询失败',
            duration: 5000,
          })
        }
      })
    }

    const rzdList = ref()

    const rzdhs = (val: any) => {
      post({
        url: "/aps/planOrder/getDropValue",
        data: {clientDyeCode: val}
      }).then(({data, code}: any) => {
        if (code === 200) {
          rzdList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    }

    const kdList = ref()

    const kdhs = (val: any) => {
      post({
        url: "/aps/planOrder/getDropValue",
        data: {customOrderName: val}
      }).then(({data, code}: any) => {
        if (code === 200) {
          kdList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    }

    const xdList = ref()

    const xdhs = (val: any) => {
      post({
        url: "/org/hrDepartment/getLikeList",
        data: {name: val}
      }).then(({data, code}: any) => {
        if (code === 200) {
          xdList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    }
    const localeText1: any = ref(localeText)
    // emitter.on('inCompanyName', (res: any) => {
    //     Tchoocl.showAdd = res
    //     selectHandler()
    // })


    // emitter.on('inOne', (res: any) => {
    //     objectOP.letmap1 = res
    //     form.a.clientDyeCode = res
    //     console.log(objectOP.letmap1, '看看是修改还是详情')
    // })

    const objectOP = reactive<{
      clothList: ClothSet[]
      showAdd: boolean
      sideTitle: string
      dropDownData: any
      pageLoading: boolean,
      theight: number,
      tablediv: any,
      rHeight: number | undefined,
      importAdd: boolean,
      letmap1: any
    }>({
      clothList: [],
      showAdd: false,
      sideTitle: "计划订单",
      dropDownData: "",
      pageLoading: false,
      theight: 0,
      tablediv: null,
      rHeight: 0,
      importAdd: false,
      letmap1: 0
    });
    const form: any = reactive(
        {
          a: {
            createName: '', // 制单人
            auditName: '', // 审核
            exchangeCalorieClassify: '',   //流转卡类型
            authorizedStrengthTime: '',   //下单日期
            orderCode: '',                //订单号
            placeDepartment: '',          //下单部门
            testCriterion: '',            //测试标准

            lastDeliveryTime: '',        //交货日期
            clientDyeCode: '',           //客户染整单号
            coloringIlluminant: '',      //对色光源
            customOrderCode: '',         //客户订单号

            dyeAuditDate: '',            //总部审核时间
            customName: '',              //客户名称
            orderNature: '',             //订单性质
            labelFormatCode: '',         //标签格式

            customOrderName: '',         //客订名称
            repairCause: '',             //回修原因
            deliveryAddress: '',         //送货地址
            ultimatelyBuyer: '',         //最终买家

            marketType: '',              //面料销售类型
            hqCraft: '',                 //总部工艺
            pack: '',                    //包装要求
            remark: '',                  //布号备注
            require: '',

            planOrderDetails: [],         //详情
            planOrderTest: [],             //测试标准
            requirement: []                 //要求
          }
        }
    );
    let guanxiForm = reactive({
      customOrderCode: '',
      clothCode: '',
      productName: '',
      colorCode: '',
      colorName: '',
      auditState: 0
    });

    let shrink = reactive({
      l: '',
      w: ''
    })

    const testAsk = [
      {headerName: "测试项目", field: "fabricVerifyProject",},
      {headerName: "测试要求", field: "verifyStandard"},
      {headerName: "客户要求", field: "verifyMaxNum"},
    ];

    const askList = [
      {headerName: "要求项目", field: "requiredItems",},
      {headerName: "本次要求", field: "nowRequirement"},
      {headerName: "默认要求", field: "defaultRequirement"},
      {headerName: "布种", field: "unit"},
      {headerName: "单位", field: "greyType"},
      {headerName: "备注", field: "remark"}
    ];

    const defaultColDefBc = {
      sortable: true,
      filter: true,
      resizable: true,
    };
    const testAskList = reactive({
      list: []
    });
    const planOderGreys = ref([])

    /********************************************************************************订单明细***************************************************************************** */

    function xuHaoFun(params: any) {
      let i = params.node.rowIndex
      i = i + 1
      return i ? i : null
    }

    const columnsOrder = [
      // {
      //     rowHeight: 100,
      //     headerName: '',//选择列头部显示的文字，可以为空
      //     checkboxSelection: true,//设置为ture显示为复选框
      //     headerCheckboxSelection: true, //表头是否也显示复选框，全选反选用
      //     pinned: 'left', //固定再左边
      //     width: 50 //列的宽度
      // },
      {
        headerName: "序号",
        cellRenderer: xuHaoFun,
        width: 100
      },
      {
        headerName: "生产方式",
        field: "productionMode",
        width: 200
      },
      {
        headerName: "加工类型",
        field: "machinType",
        width: 200
      },
      {
        headerName: "染色类型",
        field: "dyeingType",
        width: 200
      },
      {
        headerName: "缸型",
        field: "cylinderType",
        width: 200
      },
      {
        headerName: "车间",
        field: "workshop",
        cellEditor: "agSelectCellEditor",
        editable: true,
        // cellEditorParams: { values: ['染部A', '染部B'] },
        width: 200
      },
      {headerName: "布号", field: "clothCode", width: 200},
      {headerName: "品名", field: "productName", width: 200},
      {headerName: "色号", field: "colorCode", width: 200},
      {headerName: "色称", field: "colorName", width: 200},
      {headerName: "确认色", field: "affirmColor", width: 200},
      {
        headerName: "颜色深浅",
        field: "colorDepth",
        width: 200
      },
      {
        headerName: "对色资料",
        field: "contrastColor",
        cellEditor: "agSelectCellEditor",
        editable: true,
        cellEditorParams: {values: [1, 2]},
        width: 200
      },
      {headerName: "匹数", field: "houseNum", editable: true, width: 200},
      {headerName: "成品重量", field: "finishedWeight", editable: true, width: 200},
      {headerName: "投染重量", field: "castDyeWeight", editable: true, width: 200},
      {headerName: "总损耗", field: "allLoss", editable: true, width: 200},


      {
        headerName: "整理收费项目",
        field: "trimCharges",
        width: 200
      },
      {headerName: "合染类型", field: "joinDyeType", width: 200},
      {headerName: "一等品", field: "firstRate", width: 200},
      {headerName: "撞白", field: "bumpWhite", width: 200},
      {headerName: "温擦提升", field: "wetRubbing", width: 200},
      {headerName: "耐氨提升", field: "chlorineResistant", editable: true, width: 200},
      {headerName: "白色防粘处理", field: "stainResistance", width: 200},
      {headerName: "抗黄处理", field: "resistanceYellow", editable: true, width: 200},
      {headerName: "拔印", field: "dialPrinting", width: 200},
      {headerName: "重打包", field: "repeatPack", width: 200},
      {headerName: "需进缸", field: "needEnterPot", width: 200},
      {headerName: "收取染费", field: "takeDyeFee", width: 200},
      {headerName: "季节", field: "season", editable: true, width: 200},
      {
        headerName: "布种类别",
        field: "greyType",
        width: 200
      },
      {
        headerName: "坯布编号", field: "greyCode", width: 200
      },
      {headerName: "坯布名称", field: "greyName", width: 200},
      {headerName: "成分", field: "ingredient", width: 200},
      {headerName: "纱支", field: "yarnCount", width: 200},
      {headerName: "珠地边", field: "edge", width: 200},
      {headerName: "有效门幅（CM）", field: "efficacious", width: 200},
      {headerName: "克重（M2）", field: "gramWeight", width: 200},
      {headerName: "门幅上限", field: "upperLimit", editable: true, width: 200},
      {headerName: "门幅下限", field: "lowerLimit", editable: true, width: 200},
      {headerName: "克重上限", field: "gramUpperLimit", editable: true, width: 200},
      {headerName: "克重下限", field: "gramLowerLimit", editable: true, width: 200},


      {headerName: "总部商品号", field: "tradeCode", editable: true, width: 200},
      {headerName: "总部商品名称", field: "tradeName", editable: true, width: 200},
      {headerName: "总部成品布号", field: "finishedClothCode", editable: true, width: 200},
      {headerName: "总部成品名称", field: "finishedClothName", editable: true, width: 200},
      {headerName: "总部商品门幅", field: "tradeEfficacious", editable: true, width: 200},
      {headerName: "总部商品克重", field: "tradeGramWeight", editable: true, width: 200},
      {headerName: "总部总部色卡号", field: "hqCardNumber", width: 200},
      {headerName: "总部原色号", field: "rawColorCode", width: 200},
      {headerName: "总部原色称", field: "rawColorName", width: 200},


      {headerName: "客户布号", field: "customClothCode", editable: true, width: 200},
      {headerName: "客户品名", field: "customProductName", editable: true, width: 200},
      {headerName: "客户色号", field: "customColorCode", editable: true, width: 200},
      {headerName: "客户色称", field: "customColorName", editable: true, width: 200},
      {headerName: "客户po", field: "customPo", editable: true, width: 200},
      {headerName: "款号", field: "styleNumber", editable: true, width: 200},
      {headerName: "定型剪办要求", field: "finalize", editable: true, width: 200},
      {headerName: "质检剪办要求", field: "quality", editable: true, width: 200},
      // { headerName: "下单部门", field: "orderDepartment", width: 200 },


      {headerName: "回修缸号", field: "repairMachineCode", width: 200},
      {headerName: "回修布号", field: "repairClothCode", width: 200,},
      {headerName: "回修色号", field: "repairColorCode", width: 200},
      {headerName: "回修色称", field: "repairColorName", width: 200},

      {headerName: "台巨prodId", field: "prodId", width: 200},
      {headerName: "台巨seqNo", field: "seqNo", width: 200},
      {headerName: "台巨shipto地址", field: "shiptoSite", width: 200},


      {headerName: "操作",},
    ];
    const defaultColDefTc = {
      sortable: true,
      filter: true,
      flex: 0,
      resizable: true,
    };
    let tco: any[] = columnsOrder.map((o) => {
      //let obj = {}


      if (o.headerName === '操作') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "right"
        o["width"] = 70
        o['cellRenderer'] = {
          template: `
            <el-button style="color:red;" v-if="e != 2" link @click="s">删除</el-button>`,
          setup(props: any) {
            const s = () => {
              if (props.params.data.id) {
                post({
                  url: "aps/orderCustom/delete",
                  data: [props.params.data.id]
                }).then(({data, code}) => {
                  if (code === 200) {
                    form.a.planOrderDetails.splice(props.params.rowIndex, 1)
                    setTimeout(function () {
                      gridOptionyB.value.setRowData(form.a.planOrderDetails);
                    }, 0)
                  }
                });
              } else {
                form.a.planOrderDetails.splice(props.params.rowIndex, 1)
                setTimeout(function () {
                  gridOptionyB.value.setRowData(form.a.planOrderDetails);
                }, 0)
              }
              // deleteBzyq(props.params.rowIndex)

            }
            return {
              s, e: props.params.data.letBoolNum
            }
          }

        }
      }
      if (o.headerName == '染色类型') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["width"] = 200
        o['cellRenderer'] = {
          template: `
            <div>
              <a-select popup-container="html" :disabled="e == 2" class="bacClass" :allowClear="true" v-model="gx"
                        allow-search @change="a" @click="c">
                <a-option v-for="item in list" :value="item.jobType">{{ item.jobType }}</a-option>
              </a-select>
            </div>`,
          setup(props: any) {
            const gx = ref(props.params.data.dyeingType)
            const a = (val: any) => {
              props.params.data.dyeingType = val
            }
            const list = ref([])
            const c = () => {
              post({
                url: "/pdm/JobType/getFieldValue",
                data: {
                  jobType: ''
                }
              }).then(({data, code}: any) => {
                if (code === 200) {
                  list.value = data
                }
              })
            }
            return {
              gx,
              a,
              c,
              list,
              e: props.params.data.letBoolNum
            }
          }

        }
      }
      if (o.headerName == '缸型') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["width"] = 200
        o['cellRenderer'] = {
          template: `
            <div>
              <a-select popup-container="html" class="bacClass" :disabled="e == 2" :allowClear="true" v-model="gx"
                        allow-search @change="a">
                <a-option value="E缸">E缸</a-option>
                <a-option value="S缸">S缸</a-option>
              </a-select>
            </div>`,
          setup(props: any) {
            const gx = ref(props.params.data.cylinderType)
            const a = (val: any) => {
              props.params.data.cylinderType = val
            }
            return {
              gx,
              a, e: props.params.data.letBoolNum
            }
          }

        }
      }
      if (o.headerName == '颜色深浅') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["width"] = 200
        o['cellRenderer'] = {
          template: `
            <div>
              <a-select popup-container="html" :disabled="e == 2" class="bacClass" :allowClear="true" v-model="gx"
                        allow-search @change="a" @click="c">
                <a-option v-for="item in list" :value="item.shade">{{ item.shade }}</a-option>
              </a-select>
            </div>`,
          setup(props: any) {
            const gx = ref(props.params.data.colorDepth)
            const a = (val: any) => {
              props.params.data.colorDepth = val
            }
            const list = ref([])
            const c = () => {
              post({
                url: "/pdm/shade/getFieldValue",
                data: {
                  shade: ''
                }
              }).then(({data, code}: any) => {
                if (code === 200) {
                  list.value = data
                }
              })
            }
            return {
              gx,
              a,
              c,
              list, e: props.params.data.letBoolNum
            }
          }

        }
      }
      if (o.headerName == '生产方式') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectProductionMode
        o['cellRendererParams'] = {
          color: (params: any) => {
            // form.a.planOrderDetails[params.rowIndex].productionMode = params.data.productionMode
            // setTimeout(function () { gridOptionyB.value.setRowData(form.a.planOrderDetails); }, 0)
          }
        }
      }
      if (o.headerName == '加工类型') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectMachinType
        o['cellRendererParams'] = {
          color: (params: any) => {
            if (form.a.orderCode != '') {
              if (params.data.serialNo == basicData.serialNo) {
                machinTypeFun(params.data.machinType)
              }
            }

            if (form.a.orderCode == '') {
              for (let i = 0; i < form.a.planOrderDetails.length; i++) {
                if (form.a.planOrderDetails.machinType != '') {
                  basicData.serialNo = params.data.serialNo
                  // console.log(form.a.planOrderDetails, 'sssssssssssssssssssss', params)
                  machinTypeFun(params.data.machinType)
                  break;
                }
              }
            }
            form.a.planOrderDetails[params.rowIndex].machinType = params.data.machinType

            setTimeout(function () {
              gridOptionyB.value.setRowData(form.a.planOrderDetails);
            }, 0)
          }
        }
      }

      if (o.headerName == '布号') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = tagRender
        o['cellRendererParams'] = {
          color: (params: any, brandName: any) => {
            form.a.planOrderDetails[params.rowIndex].productName = brandName
            setTimeout(function () {
              gridOptionyB.value.setRowData(form.a.planOrderDetails);
            }, 0)
          }
        }
      }
      if (o.headerName == '坯布编号') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectGreyCode
        o['cellRendererParams'] = {
          color: (params: any, grayFabricName: any) => {
            form.a.planOrderDetails[params.rowIndex].greyName = grayFabricName
            setTimeout(function () {
              gridOptionyB.value.setRowData(form.a.planOrderDetails);
            }, 0)
          }
        }
      }
      if (o.headerName == '总损耗') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = {
          template: `<span>{{ s }}%</span>`,
          setup(props: any) {
            return {
              s: props.params.data.allLoss
            }
          }

        }
      }
      if (o.headerName == '车间') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = {
          template: `
            <a-select popup-container="html" allow-clear class="bacClass" placeholder="" v-model="ainfo.workshop">
              <a-option value="染部A">染部A</a-option>
              <a-option value="染部B">染部B</a-option>
            </a-select>`,
          setup(props: any) {
            return {
              ainfo: props.params.data,
            }
          },
        }
        // o['cellRendererParams'] = {
        //     color: (params: any, greyCode: any) => {
        //         // form.a.planOrderDetails[params.rowIndex].greyCode = greyCode
        //         // setTimeout(function () { gridOptionyB.value.setRowData(form.a.planOrderDetails); }, 0)
        //     }
        // }
      }
      if (o.headerName == '匹数') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = {
          template: `
            <a-input allow-clear class="bacClass" v-model="ainfo.houseNum"/>`,
          setup(props: any) {
            return {
              ainfo: props.params.data,
            }
          },
        }
      }
      if (o.headerName == '投染重量') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = {
          template: `
            <a-input allow-clear class="bacClass" v-model="ainfo.castDyeWeight" @change="changes"/>`,
          setup(props: any) {
            const changes = (val: any) => {
              nextTick(() => {
                props.params.data.houseNum = props.params.data.castDyeWeight / 25
              })

            }
            return {
              ainfo: props.params.data,
              changes
            }
          },
        }
      }
      if (o.headerName == '总部商品号') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectTradeCode
        o['cellRendererParams'] = {
          color: (params: any, greyCode: any) => {
            form.a.planOrderDetails[params.rowIndex].greyCode = greyCode
            setTimeout(function () {
              gridOptionyB.value.setRowData(form.a.planOrderDetails);
            }, 0)
          }
        }
      }


      if (o.headerName == '缸号') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectCylinder
        o['cellRendererParams'] = {
          color: (params: any, greyCode: any) => {
            // form.a.planOrderDetails[params.rowIndex].greyCode = greyCode
            // setTimeout(function () { gridOptionyB.value.setRowData(form.a.planOrderDetails); }, 0)
          }
        }
      }
      if (o.headerName == '总部布号') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectFabricNumberZ
        o['cellRendererParams'] = {
          color: (params: any, greyCode: any) => {
            // form.a.planOrderDetails[params.rowIndex].greyCode = greyCode
            // setTimeout(function () { gridOptionyB.value.setRowData(form.a.planOrderDetails); }, 0)
          }
        }
      }

      if (o.headerName == '总部色号') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectColorCodeZ
        o['cellRendererParams'] = {
          color: (params: any, greyCode: any) => {
            // form.a.planOrderDetails[params.rowIndex].greyCode = greyCode
            // setTimeout(function () { gridOptionyB.value.setRowData(form.a.planOrderDetails); }, 0)
          }
        }
      }
      if (o.headerName == '总部色称') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectColorNameZ
        o['cellRendererParams'] = {
          color: (params: any, greyCode: any) => {
            // form.a.planOrderDetails[params.rowIndex].greyCode = greyCode
            // setTimeout(function () { gridOptionyB.value.setRowData(form.a.planOrderDetails); }, 0)
          }
        }
      }


      if (o.headerName == '商品号') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectTradeCode
        o['cellRendererParams'] = {
          color: (params: any, greyCode: any) => {
            // form.a.planOrderDetails[params.rowIndex].greyCode = greyCode
            // setTimeout(function () { gridOptionyB.value.setRowData(form.a.planOrderDetails); }, 0)
          }
        }
      }


      if (o.headerName == '色号') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectColorCode
        o['cellRendererParams'] = {
          color: (params: any) => {
            form.a.planOrderDetails[params.rowIndex].colorCode = params.data.colorCode
            setTimeout(function () {
              gridOptionyB.value.setRowData(form.a.planOrderDetails);
            }, 0)
          }
        }
      }
      if (o.headerName == '色称') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectColorName
        o['cellRendererParams'] = {
          color: (params: any) => {
            form.a.planOrderDetails[params.rowIndex].colorName = params.data.colorName
            setTimeout(function () {
              gridOptionyB.value.setRowData(form.a.planOrderDetails);
            }, 0)
          }
        }
      }

      if (o.headerName == '下单部门') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectOrdering
        o['cellRendererParams'] = {
          color: (params: any, greyCode: any) => {
            // form.a.planOrderDetails[params.rowIndex].greyCode = greyCode
            // setTimeout(function () { gridOptionyB.value.setRowData(form.a.planOrderDetails); }, 0)
          }
        }
      }
      if (o.headerName == '确认色') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectAffirmColor
        o['cellRendererParams'] = {
          color: (params: any) => {
            form.a.planOrderDetails[params.rowIndex].affirmColor = params.data.affirmColor
            setTimeout(function () {
              gridOptionyB.value.setRowData(form.a.planOrderDetails);
            }, 0)
          }
        }
      }
      // if (o.headerName == '染色类型') {
      //     o['resizable'] = true
      //     o['filter'] = false
      //     o['sortable'] = false
      //     o["pinned"] = "light"
      //     o["width"] = 200
      //     o['cellRenderer'] = selectDyeingType
      //     o['cellRendererParams'] = {
      //         color: (params: any) => {
      //             form.a.planOrderDetails[params.rowIndex].dyeingType = params.data.dyeingType
      //             setTimeout(function () { gridOptionyB.value.setRowData(form.a.planOrderDetails); }, 0)
      //         }greyTyp
      //     }
      // }

      if (o.headerName == '季节') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectSeason
        o['cellRendererParams'] = {
          color: (params: any) => {
            form.a.planOrderDetails[params.rowIndex].season = params.data.season
            setTimeout(function () {
              gridOptionyB.value.setRowData(form.a.planOrderDetails);
            }, 0)
          }
        }
      }
      if (o.headerName == '布种类别') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectGreyType
        o['cellRendererParams'] = {
          color: (params: any) => {
            form.a.planOrderDetails[params.rowIndex].greyType = params.data.greyType
            setTimeout(function () {
              gridOptionyB.value.setRowData(form.a.planOrderDetails);
            }, 0)
          }
        }
      }
      if (o.headerName == '整理收费项目') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 200
        o['cellRenderer'] = selectTrimCharges
        o['cellRendererParams'] = {
          color: (params: any) => {
            form.a.planOrderDetails[params.rowIndex].trimCharges = params.data.trimCharges
            setTimeout(function () {
              gridOptionyB.value.setRowData(form.a.planOrderDetails);
            }, 0)
          }
        }
      }
      // if (o.headerName == '颜色深浅') {
      //     o['resizable'] = true
      //     o['filter'] = false
      //     o['sortable'] = false
      //     o["pinned"] = "light"
      //     o["width"] = 200
      //     o['cellRenderer'] = selectColorDepth
      //     o['cellRendererParams'] = {
      //         color: (params: any) => {
      //             form.a.planOrderDetails[params.rowIndex].colorDepth = params.data.colorDepth
      //             setTimeout(function () { gridOptionyB.value.setRowData(form.a.planOrderDetails); }, 0)
      //         }
      //     }
      // }
      if (o.headerName == '珠地边') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = checheCkEdgeCK
        o['cellRendererParams'] = {
          color: (params: any,) => {
            form.a.planOrderDetails[params.rowIndex].edge = params.data.edge
          }
        }
      }
      if (o.headerName == '撞白') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = cheCkBumpWhite
        o['cellRendererParams'] = {
          color: (params: any,) => {
            form.a.planOrderDetails[params.rowIndex].bumpWhite = params.data.bumpWhite

          }
        }
      }
      if (o.headerName == '合染类型') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = cheCKStaining
        o['cellRendererParams'] = {
          color: (params: any,) => {
            form.a.planOrderDetails[params.rowIndex].joinDyeType = params.data.joinDyeType

          }
        }
      }
      if (o.headerName == '一等品') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = cheCkFirstRate
        o['cellRendererParams'] = {
          color: (params: any,) => {
            form.a.planOrderDetails[params.rowIndex].firstRate = params.data.firstRate

          }
        }
      }
      if (o.headerName == '拔印') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = CheCkdialPrinting
        o['cellRendererParams'] = {
          color: (params: any,) => {
            form.a.planOrderDetails[params.rowIndex].dialPrinting = params.data.dialPrinting
          }
        }
      }
      if (o.headerName == '温擦提升') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = cheCkwetRubbing
        o['cellRendererParams'] = {
          color: (params: any,) => {
            form.a.planOrderDetails[params.rowIndex].wetRubbing = params.data.wetRubbing

          }
        }
      }
      if (o.headerName == '白色防粘处理') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = cheCkstainResistance
        o['cellRendererParams'] = {
          color: (params: any,) => {
            form.a.planOrderDetails[params.rowIndex].stainResistance = params.data.stainResistance

          }
        }
      }
      if (o.headerName == '需进缸') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = cheCKneedEnterPot
        o['cellRendererParams'] = {
          color: (params: any,) => {
            form.a.planOrderDetails[params.rowIndex].needEnterPot = params.data.needEnterPot
          },
          data: {
            needEnterPot: true
          }
        }
      }
      if (o.headerName == '收取染费') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = cheCktakeDyeFee
        o['cellRendererParams'] = {
          color: (params: any,) => {
            form.a.planOrderDetails[params.rowIndex].takeDyeFee = params.data.takeDyeFee
          },
          data: {
            takeDyeFee: true
          }
        }
      }
      if (o.headerName == '重打包') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = cheCkrepeatPack
        o['cellRendererParams'] = {
          color: (params: any,) => {
            form.a.planOrderDetails[params.rowIndex].repeatPack = params.data.repeatPack
          }
        }
      }


      if (o.headerName == '耐氨提升') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = cheCkChlorineResistant
        o['cellRendererParams'] = {
          color: (params: any,) => {

          }
        }
      }


      if (o.headerName == '抗黄处理') {
        o['resizable'] = true
        o['filter'] = false
        o['sortable'] = false
        o["pinned"] = "light"
        o["width"] = 150
        o['cellRenderer'] = cheCkResistanceYellow
        o['cellRendererParams'] = {
          color: (params: any,) => {

          }
        }
      }

      // if (o.headerName == '重打包') {
      //     o['resizable'] = false
      //     o['filter'] = false
      //     o['sortable'] = false
      //     o["pinned"] = "light"
      //     o["width"] = 150
      //     o['cellRenderer'] = {
      //         template: `<div>
      //             <a-checkbox @click="s"></a-checkbox>
      //                   </div>`,
      //         setup(props: any) {
      //             const s = () => {
      //                 form.a.planOrderDetails[props.params.rowIndex].repeatPack = form.a.planOrderDetails[props.params.rowIndex].repeatPack == 0 ? 1 : 0
      //             }
      //             return {
      //                 s
      //             }
      //         }

      //     }
      // }

      return o
    })


    const rowData = [
      {make: "Toyota", model: "Celica", price: 35000},
      {make: "Ford", model: "Mondeo", price: 32000},
      {make: "Porsche", model: "Boxster", price: 72000},
      {make: "Toyota", model: "Celica", price: 35000},
      {make: "Ford", model: "Mondeo", price: 32000},
      {make: "Porsche", model: "Boxster", price: 72000},
      {make: "Toyota", model: "Celica", price: 35000},
      {make: "Ford", model: "Mondeo", price: 32000},
      {make: "Porsche", model: "Boxster", price: 72000},
    ];
    /********************************************************************************总坯布信息********************************************************************* */
    const total = [
      {
        headerName: '',//选择列头部显示的文字，可以为空
        checkboxSelection: true,//设置为ture显示为复选框
        headerCheckboxSelection: true, //表头是否也显示复选框，全选反选用
        pinned: 'left', //固定再左边
        width: 50 //列的宽度
      },
      {headerName: "布号", field: "greyCode",},
      {headerName: "品名", field: "greyName"},
      {headerName: "色号", field: "yarnHouseNum"},
      {headerName: "色称", field: "houseNum",},
      {headerName: "备坯单号", field: "weight"},
      {headerName: "坯布名称", field: "lenghtNum"},
      {headerName: "等级", field: "clothCode",},
      {headerName: "机台号", field: "productName"},
      {headerName: "纱批", field: "colorCode"},
      {headerName: "匹数", field: "colorName",},
      {headerName: "重量", field: "larghezza"},
      {headerName: "织厂", field: "larghezza"},
    ];

    //测试标准
    function testCriterionFun() {
      post({
        url: "/pdm/VerifyStandard/getFieldValue",
        data: {
          verifyStandard: ''
        }
      }).then(({data, code}: any) => {
        if (code === 200) {
          basicData.VerifyStandard = data
        }

      }).catch(console.log).finally(() => {
        objectOP.pageLoading = false
      });
    }

    function testCriterionCk(val: any) {
      post({
        url: "/pdm/CustomVerifyProject/getAllInfo",
        data: {
          verifyStandard: val
        }
      }).then(({data, code}: any) => {
        if (code === 200) {
          testAskList.list = data
          shrink.w = data[0].verifyMinNum
          shrink.l = data[0].verifyMinNum


        }

      }).catch(console.log).finally(() => {
        objectOP.pageLoading = false
      });
    }


    /*****************************************************对色光源****************************************************** */
        //下拉框焦点
    const coloringIlluminantFun = () => {
          coloringIlluminantAll({colourLight: ''})
        };
    //下拉数据
    const coloringIlluminantSear = (val: any) => {
      loading.value = true;
      coloringIlluminantAll({colourLight: val});
      options.value = pageDataList.value;
      loading.value = false;
    };

    function coloringIlluminantAll(val: any) {
      post({
        url: "/pdm/coloringMatch/getFieldValue",
        data: val
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageDataList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    }

    /****************************************************************客户名称************************************************************** */
    const customNameFun = () => {
      customNameAll({customName: ''})
    };
    const customNameSear = (val: any) => {
      loading.value = true;
      coloringIlluminantAll({customName: val});
      options.value = pageDataList.value;
      loading.value = false;
    };

    function customNameAll(val: any) {
      post({
        url: "/aps/custom/getDropValue",
        data: val
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageDataList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    }


    /********************************************************订单性质****************************************************/
    function orderNatureFun(backName: any) {
      post({
        url: "dict/dictType/getList",
        data: {
          typeName: backName,
          deleteState: 0
        }
      }).then(({data, code}: any) => {
        if (code === 200) {
          if (data[0].codeType != 'undefined') {
            getOrderNature(data[0].codeType, backName)
          }
        }
      }).catch(console.log).finally(() => {
        objectOP.pageLoading = false
      });
    }

    function getOrderNature(codeType: any, dictionary: any) {
      post({
        url: "dict/dictTypeDetail/getList",
        data: {
          codeType: codeType,
          obsoleteState: 0,
          deleteState: 0
        }
      }).then(({data, code}: any) => {
        if (code === 200) {
          switch (dictionary) {
            case '订单性质':
              basicData.orderNature = data
              break;
            case '结算方式':
              basicData.Calculation = data
              break;
            case '面料销售类型':
              basicData.plusMaterial = data
              break;
            case '结算公司':
              basicData.corporation = data
              break;
          }
        }
      }).catch(console.log).finally(() => {
        objectOP.pageLoading = false
      });
    }

    /***********************************************标签格式****************************************************/
    const labelFormatCodeFun = () => {
      labelFormatCodeAll({labelFormat: ''})
    };
    const labelFormatCodeSear = (val: any) => {
      loading.value = true;
      labelFormatCodeAll({labelFormat: val});
      options.value = pageDataList.value;
      loading.value = false;
    };

    function labelFormatCodeAll(val: any) {
      post({
        url: "/aps/labelFormat/getDropValue",
        data: val
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageDataList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    };
    /***********************************************标签格式****************************************************/
    const exchangeCalorieClassifyFun = () => {
      exchangeCalorieClassifyAll({exchangeCalorieClassify: ''})
    };
    const exchangeCalorieClassifySear = (val: any) => {
      loading.value = true;
      exchangeCalorieClassifyAll({exchangeCalorieClassify: val});
      options.value = pageDataList.value;
      loading.value = false;
    };

    function exchangeCalorieClassifyAll(val: any) {
      post({
        url: "/aps/ExchangecalorieClassify/getDropValue",
        data: val
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageDataList.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    };
    /***************************************************回修原因********************************************************** */
    const repairCauseFun = () => {
      repairCauseAll({repairCause: ''})
    };
    const repairCauseSear = (val: any) => {
      loading.value = true;
      repairCauseAll({repairCause: val});
      options.value = pageDataList.value;
      loading.value = false;
    };

    function repairCauseAll(val: any) {
      post({
        url: "/dwWorkShop/repairCause/selectRepairCause",
        data: val
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageDataList.value = data.data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    };

    /************************************************总部坯布查询********************************************* */
    function countBu() {
      post({
        url: "/wms/GreyStock/getClothInfo",
        data: {
          greyCode: '1',
          greyName: '1'
        }
      }).then(({data, code}: any) => {
        if (code === 200) {
          planOderGreys.value = data;
        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    };

    /*****************************************************导入后台巨客户******************************************************** */
    let yesOrderList: any = [];
    const gridOptionB = ref()
    const gridReadyB = (params: any) => {
      gridOptionB.value = params.api
    }

    const gridOptionC = ref()
    const gridReadyC = (params: any) => {
      gridOptionC.value = params.api
    }


    let planOrderDetails = {
      serialNo: 0,
      productionMode: '',
      machinType: '外加工染色',
      dyeingType: '',
      cylinderType: '',
      workshop: '',
      clothCode: '',
      productName: '',
      colorCode: '',
      colorName: '',
      affirmColor: '',
      colorDepth: '',
      contrastColor: '',
      houseNum: '',
      finishedWeight: '',
      castDyeWeight: '',
      allLoss: '',
      trimCharges: '',
      joinDyeType: '',
      firstRate: '',
      bumpWhite: '',
      wetRubbing: '',
      chlorineResistant: '',
      stainResistance: '',
      resistanceYellow: '',
      dialPrinting: '',
      repeatPack: '',
      needEnterPot: '',
      takeDyeFee: '',
      season: '',
      greyType: '',
      greyCode: '',
      greyName: '',
      ingredient: '',
      yarnCount: '',
      edge: '',
      efficacious: '',
      gramWeight: '',
      upperLimit: '',
      lowerLimit: '',
      gramUpperLimit: '',
      gramLowerLimit: '',
      tradeCode: '',
      tradeName: '',
      finishedClothCode: '',
      finishedClothName: '',
      tradeEfficacious: '',
      tradeGramWeight: '',
      hqCardNumber: '',
      rawColorCode: '',
      rawColorName: '',
      customClothCode: '',
      customProductName: '',
      customColorCode: '',
      customColorName: '',
      customPo: '',
      styleNumber: '',
      finalize: '',
      quality: '',
      orderDepartment: '',
      repairMachineCode: '',
      repairClothCode: '',
      repairColorCode: '',
      repairColorName: '',
      prodId: '',
      seqNo: '',
      shiptoSite: '',
      letmap: 0,

    };

    //订单明细新增
    const planOrderDetailsAdd = () => {
      planOrderDetails.serialNo = planOrderDetails.serialNo + 1
      form.a.planOrderDetails.push(JSON.parse(JSON.stringify(planOrderDetails)))
      setTimeout(function () {
        gridOptionyB.value.setRowData(form.a.planOrderDetails);
      }, 0)
    }
    const gridOptionyB = ref();
    const gridReadyeB = (params: any,) => {
      gridOptionyB.value = params.api
      console.log("触发", gridOptionyB.value.setRowData());
    };
    const orderCustomList = reactive({
      list: []
    });
    const exCustomer = () => {
      for (let key in guanxiForm) {
        guanxiForm[key] = ''
      }
      guanxiForm.auditState = 0
      guanxiCount()
      objectOP.showAdd = false
      objectOP.importAdd = true
    };
    const showJu = ref<boolean>(true)
    const hugeCustomer = [
      {
        headerName: '',//选择列头部显示的文字，可以为空
        checkboxSelection: true,//设置为ture显示为复选框
        headerCheckboxSelection: true, //表头是否也显示复选框，全选反选用
        pinned: 'left', //固定再左边
        width: 50 //列的宽度
      },
      {headerName: "客户订单号", field: "customOrderCode",},
      {headerName: "卖家名称", field: "buyerName"},
      {headerName: "客户名称", field: "customOrderName"},
      {headerName: "客户跟单", field: "clientDocumentary",},
      {headerName: "下单日期", field: "authorizedStrengthTime"},
      {headerName: "交货日期", field: "deliveryTime"},
      {headerName: "季节", field: "season",},
      {headerName: "款号", field: "styleNumber"},
      {headerName: "布号", field: "clothCode"},
      {headerName: "品名", field: "productName",},
      {headerName: "系统品名", field: "systemProductName",},
      {headerName: "门幅", field: "larghezza"},
      {headerName: "克重", field: "gWeight"},
      {headerName: "颜色代码", field: "colorNum"},
      {headerName: "色号", field: "colorCode"},
      {headerName: "色称", field: "colorName"},
      {headerName: "确认色", field: "affirmColor"},
      {headerName: "客户色称", field: "customColorName"},
      {headerName: "对色资料", field: "contrastColor"},
      {headerName: "测试标准", field: "testCriterion"},
      {headerName: "成分", field: "ingredient"},
      {headerName: "po号", field: "customPoCode"},
      {headerName: "投染重量", field: "castDyeWeight"},
      {headerName: "投染码数", field: "castDyeYardage"},
      {headerName: "投染磅数", field: "castDyePound"},

      {headerName: "成品磅数", field: "finishedClothPound"},
      {headerName: "备注", field: "remark"},
      {headerName: "导入人", field: "importPerson"},
      {headerName: "导入日期", field: "importDate"},
      {headerName: "客户品名", field: "customProductName"},
    ];

    function checkDuplicateClothCode(array: any) {
      // var clothCodeSet = new Set();
      // for (var i = 0; i < array.length; i++) {
      //     var item = array[i];
      //     if (clothCodeSet.has(item.customOrderCode)) {
      //         return true;
      //     }
      //     clothCodeSet.add(item.customOrderCode);
      // }
      // return false;
      const firstId = array[0].customOrderCode;
      for (let i = 1; i < array.length; i++) {
        if (array[i].customOrderCode != firstId) {
          return false;
        }
      }
      return true;
    }

    // 数据流方法
    const sideaOKcopy = () => {
      yesOrder()
      if (yesOrderList.length > 0) {
        form.a.placeDepartment = yesOrderList[0].firmName
        form.a.deliveryAddress = yesOrderList[0].deliveryAddress
        form.a.hqCraft = yesOrderList[0].hqCraft
        form.a.customOrderCode = yesOrderList[0].customOrderCode
        form.a.testCriterion = yesOrderList[0].testCriterion
        form.a.customOrderName = yesOrderList[0].customOrderName
        form.a.authorizedStrengthTime = new Date(yesOrderList[0].authorizedStrengthTime)
        form.a.customName = '台巨纺织'
        form.a.ultimatelyBuyer = yesOrderList[0].buyerName
        form.a.require = yesOrderList[0].remark
        form.a.lastDeliveryTime = new Date(yesOrderList[0].deliveryTime)
        for (let i = 0; i < yesOrderList.length; i++) {
          let a = {...planOrderDetails, ...yesOrderList[i]}
          a.machinType = '外加工染色'
          if (a.customName == '台巨') {
            console.log(a.colorCode)
            // if(a.colorCode){
            //     a.affirmColor = a.colorCode.split('-')[2].match(/[A-Za-z]/)[0]
            // }
          }
          a.customProductName = a.customProductName
          a.customColorCode = a.colorNum
          a.customPo = a.customPoCode
          a.shiptoSite = a.shipto
          a.affirmColor = a.colorCode.split('-')[a.colorCode.split('-').length - 1]
          a.finishedWeight = Number(a.weightB)
          if (a.castDyeWeight === 0) {
            a.allLoss = 0
            a.houseNum = 0
          } else {
            a.allLoss = Number(a.weightB) / a.castDyeWeight
            a.houseNum = Math.ceil(a.castDyeWeight / 25)
          }
          a.finishedWeight = a.finishedClothPound
          a.allLoss = Number(a.finishedClothPound / a.castDyeWeight).toFixed(2)
          post({
            url: "pdm/DevFabricInfo/getInfoByCloth",
            data: {
              "clothCode": a.clothCode,
              "colorCode": a.colorCode
            }
          }).then(({data, code}) => {
            if (code === 200) {
              a.cylinderType = data[0]?.cylinderType
              // a.colorDepth = data[0]?.colorDepth
              // a.dyeingType = data[0]?.dyeTypeName
              a.craftCode = data[0]?.produceFlowName
              a.greyType = data[0]?.clothKindType
              a.efficacious = data[0]?.validWidth
              a.upperLimit = data[0]?.widthUpperLimit
              a.lowerLimit = data[0]?.widthLowerLimit
              a.gramWeight = data[0]?.fabricWeight
              a.gramUpperLimit = data[0]?.weightUpperLimit
              a.gramLowerLimit = data[0]?.weightLowerLimit
              a.greyCode = data[0]?.grayCode
            } else {
              Message.error({
                content: "查询失败！",
                duration: 5000,
              });
            }
          });
          form.a.planOrderDetails.push(JSON.parse(JSON.stringify(a)))
          setTimeout(function () {
            gridOptionyB.value.setRowData(form.a.planOrderDetails);
          }, 0)
        }
        form.a.colourSum = form.a.planOrderDetails.length
        if (form.a.orderCode == '') {
          for (let i = 0; i < form.a.planOrderDetails.length; i++) {
            if (form.a.planOrderDetails[i].machinType != '') {
              machinTypeFun(form.a.planOrderDetails[i].machinType)
              break;
            }
          }
        }
        showJu.value = false
      }
      objectOP.importAdd = false
      objectOP.showAdd = true;
      count()
    }
    //导入巨客户订单
    const sideaOk = () => {
      if (mobanYnKey.value == 1) {
        if (gridOptionB.value.getSelectedRows().length === 0) {
          objectOP.importAdd = false
        } else if (gridOptionB.value.getSelectedRows().length === 1) {
          sideaOKcopy()
        } else {
          if (!checkDuplicateClothCode(gridOptionB.value.getSelectedRows())) {
            // Message.error({
            //     content: "选取的数据 客户订单号 必须相同！",
            //     duration: 5000,
            // });
            // 这里的判断为所勾选的数据中客订号不同
            let obList = gridOptionB.value.getSelectedRows()
            // const idList = obList.map((item: any) => item.id);
            const idList: any = [];
            obList.forEach((item: any) => {
              if ('id' in item) {
                idList.push({id: item['id']});
              }
            });
            // let newBool = false
            post({
              url: "aps/planOrder/addInfo",
              data: idList
            }).then(({data, code}) => {
              if (code === 200) {
                // emitter.emit('inCompanyName', newBool);
                Tchoocl.showAdd = false
                selectHandler()
                yesOrder()
                showJu.value = false
                objectOP.importAdd = false
                objectOP.showAdd = true;
              }
            });
          } else {
            yesOrder()
            if (yesOrderList.length > 0) {
              form.a.placeDepartment = yesOrderList[0].firmName
              form.a.deliveryAddress = yesOrderList[0].deliveryAddress
              form.a.hqCraft = yesOrderList[0].hqCraft
              form.a.customOrderCode = yesOrderList[0].customOrderCode
              form.a.testCriterion = yesOrderList[0].testCriterion
              form.a.customOrderName = yesOrderList[0].customOrderName
              form.a.authorizedStrengthTime = new Date(yesOrderList[0].authorizedStrengthTime)
              form.a.customName = '台巨纺织'
              form.a.ultimatelyBuyer = yesOrderList[0].buyerName
              form.a.require = yesOrderList[0].remark
              form.a.lastDeliveryTime = new Date(yesOrderList[0].deliveryTime)
              for (let i = 0; i < yesOrderList.length; i++) {
                let a = {...planOrderDetails, ...yesOrderList[i]}
                a.machinType = '外加工染色'
                a.customProductName = a.customProductName
                a.customColorCode = a.colorNum
                a.customPo = a.customPoCode
                a.shiptoSite = a.shipto
                a.finishedWeight = Number(a.weightB)
                a.affirmColor = a.colorCode.split('-')[a.colorCode.split('-').length - 1]
                if (a.castDyeWeight === 0) {
                  a.allLoss = 0
                } else {
                  a.allLoss = Number(a.weightB) / a.castDyeWeight
                }
                a.allLoss = Number(a.finishedClothPound / a.castDyeWeight).toFixed(2)

                post({
                  url: "pdm/DevFabricInfo/getInfoByCloth",
                  data: {
                    "clothCode": a.clothCode,
                    "colorCode": a.colorCode
                  }
                }).then(({data, code}) => {
                  if (code === 200) {
                    // dataList.value = data[0].
                    a.cylinderType = data[0]?.cylinderType
                    a.colorDepth = data[0]?.colorDepth
                    a.dyeingType = data[0]?.dyeTypeName
                    a.craftCode = data[0]?.produceFlowName
                    a.greyType = data[0]?.clothKindType
                    a.efficacious = data[0]?.validWidth
                    a.upperLimit = data[0]?.widthUpperLimit
                    a.lowerLimit = data[0]?.widthLowerLimit
                    a.gramWeight = data[0]?.fabricWeight
                    a.gramUpperLimit = data[0]?.weightUpperLimit
                    a.gramLowerLimit = data[0]?.weightLowerLimit

                  } else {
                    Message.error({
                      content: "查询失败！",
                      duration: 5000,
                    });
                  }
                });
                form.a.planOrderDetails.push(JSON.parse(JSON.stringify(a)))
                setTimeout(function () {
                  gridOptionyB.value.setRowData(form.a.planOrderDetails);
                }, 0)
              }
              form.a.colourSum = form.a.planOrderDetails.length
              if (form.a.orderCode == '') {
                for (let i = 0; i < form.a.planOrderDetails.length; i++) {
                  if (form.a.planOrderDetails[i].machinType != '') {
                    machinTypeFun(form.a.planOrderDetails[i].machinType)
                    break;
                  }
                }
              }
              showJu.value = false
            }
            objectOP.importAdd = false
            objectOP.showAdd = true;
            count()
          }
        }
      } else if (mobanYnKey.value == 2) {
        post({
          url: "aps/orderCustom/delete",
          data: gridOptionC.value.getSelectedRows().map((res: any) => {
            return res.id
          })
        }).then(({data, code}) => {
          if (code === 200) {
            guanxiForm.auditState = 1
            guanxiCount()
          }
        });
      }


    };
    const yesOrder = () => {
      yesOrderList = gridOptionB.value.getSelectedRows()
      if (trigger.value == '1') {
        gridOptionB.value.getSelectedRows().map((item: any) => {
          // 循环勾选数据
          // return item.customOrderCode
          return orderCustomList.list.map((se, index) => {
            // 循环表格总数据
            if (se['id'] === item.id) {
              orderCustomList.list.splice(index, 1)
              setTimeout(function () {
                gridOptionB.value.setRowData(orderCustomList.list);
              }, 0)
            }
          })
        })
      } else {
        gridOptionB.value.getSelectedRows().map((item: any) => {
          return item.customOrderCode
        })
      }

      console.log(yesOrderList, 'ss')
      baocun(yesOrderList)

    }
    const baocun = (data: any) => {
      post({
        url: "/aps/orderCustom/confirm",
        data: data
      }).then(({data, code, message}: any) => {
        // console.log(data,"下拉返回");
        if (code === 200) {
          Message.success({
            content: "保存成功",
            duration: 200,
          });

        } else {
          Message.error({
            content: message,
            duration: 5000,
          });
        }
      });
    }
    let guanxiData = {
      houseNum: 0,
      finishedWeight: 0,
      castDyeWeight: 0
    }

    function count() {
      let a = 0;
      let b = 0;
      let c = 0;
      for (var i = 0; i < form.a.planOrderDetails.length; i++) {
        a = a + Number(form.a.planOrderDetails[i].houseNum)
        b = b + Number(form.a.planOrderDetails[i].finishedWeight)
        c = c + Number(form.a.planOrderDetails[i].castDyeWeight)
      }
      var topRows = [
        {headerName: '合计', houseNum: a, finishedWeight: b, castDyeWeight: c}
      ];
      guanxiData = {
        houseNum: Number(a),
        finishedWeight: Number(b),
        castDyeWeight: Number(c)
      }
      // gridOptionyB.value.setPinnedBottomRowData(topRows);
    };

    const sideaNo = () => {
      // for (let i = 0; i < yesOrderList.length; i++) {
      //     let a = { ...planOrderDetails, ...yesOrderList[i] }
      //     form.a.planOrderDetails.push(JSON.parse(JSON.stringify(a)))
      //     setTimeout(function () { gridOptionyB.value.setRowData(form.a.planOrderDetails); }, 0)
      // }

      objectOP.importAdd = false
      objectOP.showAdd = true;

      // 传递新增页面的指示！
      // console.log(Tchoocl.showAdd, '试试不传递能否有效')
      count()
    };

    //查询
    const guanxiCount = () => {
      post({
        url: "/aps/orderCustom/getList",
        data: guanxiForm
      }).then(({data, code}: any) => {
        // console.log(data,"下拉返回");
        console.log(data)
        if (code === 200) {
          orderCustomList.list = data;
        }
      });
    };

    const mobanYnKey: any = ref(1)


    const mobanYn = (key: any) => {
      mobanYnKey.value = key
      if (key == 1) {
        guanxiForm.auditState = 0
        guanxiCount()
      } else {
        guanxiForm.auditState = 1
        guanxiCount()
      }
    }
    //模板下载
    const downloadHandler = () => {
      axios.get('/api/aps/orderCustom/uploadOrderCustomeModel', {
        responseType: 'blob',
        headers: {
          token: sessionStorage.getItem('USER-TOKEN-KEY')
        }
      }).then((res) => {
        if (res.status === 200) {
          filedownload(res.data, '巨客户模板.xlsx')
        }
      })
    };

    //导入
    const importHandler = () => {
      const inputEle: HTMLInputElement = document.createElement('input')
      inputEle.type = 'file'
      inputEle.id = 'fileUploadExcel'
      inputEle.accept = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel'
      inputEle.addEventListener('change', (e) => {
        const formData = new FormData()
        if (inputEle.files !== null) {
          formData.append('file', inputEle.files[0] || '')
          formData.append('customOrderCode', form.a.customOrderCode)
        } else {
          Message.warning('未选择文件！');
          return
        }
        objectOP.pageLoading = true
        axios.post('/api/aps/orderCustom/analyseOrderCustomeModel',
            formData,
            {
              headers: {
                "Content-Type": 'multipart/form-data',
                "token": sessionStorage.getItem('USER-TOKEN-KEY')
              },
            }).then((result) => {
          if (result.data['code'] === 200) {
            for (let i = 0; i < result.data['data'].length; i++) {
              result.data['data'][i].id = null
            }
            orderCustomList.list = result.data['data']
            Message.success('导入成功')
            guanxiCount()
          } else {
            Message.error(result.data.message)
          }

        }).finally(() => {
          // objectOP.pageLoading = false
          // doRefresh()
          post({
            url: "/aps/orderCustom/getList",
          }).then(({data, code}: any) => {
            if (code === 200) {
              // orderCustomList.list = data
            }
          }).catch(console.log).finally(() => {
            objectOP.pageLoading = false
          });
        })
      })
      inputEle.click()
    }

    /*******************************************取布号********************************************************/
    const clothCodeBoSel = () => {
      clothCodeAll({clothCode: "", auditState: 1, deleteState: 0, obsoleteState: 0})
    }
    let optionsList = ref([])
    let clothCodeList = ref<any>(optionsList.value);
    let clothCodeBo = ref(false);

    const clothCodeSearch = (value: any) => {
      const ob = {clothCode: value, auditState: 1, deleteState: 0, obsoleteState: 0}
      clothCodeBo.value = true;
      clothCodeAll(ob);
      clothCodeList.value = optionsList.value;
      clothCodeBo.value = false;
    };

    function clothCodeAll(val: any) {
      post({
        url: "/pdm/DevFabricInfo/getLikeList",
        data: val
      }).then(({data, code, message}: any) => {
        if (code === 200) {
          optionsList.value = data;
        } else {
          Message.error({
            content: message,
            duration: 5000,
          });
        }
      });
    }

    /********************************************************************取品名************************************************************************ */
    let pinList = ref([])
    const clothCodeBoSelA = () => {
      clothCodeAllA({brandName: "", auditState: 1, deleteState: 0, obsoleteState: 0})
    }
    let clothCodeListA = ref<any>(pinList.value);
    let clothCodeBoA = ref(false);

    const clothCodeSearchA = (value: any) => {
      const ob = {brandName: value, auditState: 1, deleteState: 0, obsoleteState: 0}
      clothCodeBoA.value = true;
      clothCodeAllA(ob);
      clothCodeListA.value = pinList.value;
      clothCodeBoA.value = false;
    };

    function clothCodeAllA(val: any) {
      post({
        url: "/pdm/DevFabricInfo/getLikeList",
        data: val
      }).then(({data, code, message}: any) => {
        if (code === 200) {
          pinList.value = data;
        } else {
          Message.error({
            content: message,
            duration: 5000,
          });
        }
      });
    }

    const getSonList = ref([])

    function GetSon() {
      post({
        url: "/pdm/RequireClassify/getSon",
      }).then((re: any) => {
        if (re.length > 0) {
          form.a.requirement = re
        } else {
          Message.error({
            content: '客户要求查询出错',
            duration: 5000,
          });
        }

      });
    }

    function testGetSon() {
      post({
        url: "/pdm/CustomVerifyProject/getAllInfo",
        data: {verifyStandard: '测试14'}
      }).then(({data, code, message}: any) => {
        if (code === 200) {
          form.a.planOrderTest = data;
        } else {
          Message.error({
            content: message,
            duration: 5000,
          });
        }
      });
    }

    function orderCodeFun() {
      post({
        url: "/pdm/CustomVerifyProject/getAllInfo",
        data: {verifyStandard: '测试14'}
      }).then(({data, code, message}: any) => {
        if (code === 200) {
          form.a.planOrderTest = data;
        } else {
          Message.error({
            content: message,
            duration: 5000,
          });
        }
      });
    }

    /************************************************************************************下单部门*********************************************************************************** */
    const placeDepartmentFun = () => {
      placeDepartmentAll({name: ''})
    };
    const placeDepartmentSear = (val: any) => {
      loading.value = true;
      placeDepartmentAll({name: val});
      options.value = pageDataList.value;
      loading.value = false;
    };

    function placeDepartmentAll(val: any) {
      post({
        url: "/org/hrDepartment/getLikeList",
        data: val
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageDataList.value = data;

        } else {
          Message.error({
            content: "查询失败！",
            duration: 5000,
          });
        }
      });
    };

    const formRef = ref<FormInstance>()

    function save() {
      formRef.value?.validate().then((err) => {
        if (!err) {
          form.a.pack = basicData.pack + '/' + basicData.packA + '/' + basicData.packB
          if (pageData.sideTitle == '新增计划订单') {
            if (form.a.id != undefined) {
              form.a.id = ''
            }
            post({
              url: "/aps/planOrder/insert",
              data: form.a
            }).then(({data, code, message}: any) => {
              if (code === 200) {
                formRef.value?.resetFields()
                for (var key in data) {
                  form.a[key] = data[key];
                }
                if (form.a.pack == undefined) {
                  basicData.pack = ''
                  basicData.packA = ''
                  basicData.packB = ''
                } else {
                  let splitArray = form.a.pack.split('/');
                  basicData.pack = splitArray[0]
                  basicData.packA = splitArray[1]
                  basicData.packB = splitArray[2]
                }
                if (data.planOrderTest.length != 0 && data.planOrderTest != undefined) {
                  testAskList.list = data.planOrderTest
                  shrink.w = data.planOrderTest[0].verifyMinNum
                  shrink.l = data.planOrderTest[0].verifyMaxNum
                }
                form.a.planOrderDetails = data.detailInfo
                Message.success({
                  content: message,
                  duration: 200,
                });
              } else {
                Message.error({
                  content: message,
                  duration: 5000,
                });
              }
            });
          } else {
            post({
              url: "aps/planOrder/update",
              data: form.a
            }).then(({data, code, message}: any) => {
              if (code === 200) {
                formRef.value?.resetFields()
                Message.success({
                  content: message,
                  duration: 200,
                });
                Tchoocl.showAdd = false
              } else {
                Message.error({
                  content: message,
                  duration: 5000,
                });
              }
            });
          }
        }
      });
    };

    function toExamine(auditState: any) {
      let arr = []
      for (let i = 0; i < form.a.planOrderDetails.length; i++) {
        arr.push({
          detail1Id: 0,
          auditState: auditState,
          orderCode: form.a.orderCode,
          serialNo: form.a.planOrderDetails[i].serialNo
        })
      }
      post({
        url: "/aps/planOrder/audit",
        data: arr
      }).then(({data, code, message}: any) => {
        if (code === 200) {
          Message.success({
            content: message,
            duration: 200,
          });
          Tchoocl.showAdd = false
          // if (auditState == 1) {
          //     objectOP.letmap1 = 2
          // } else {
          //     objectOP.letmap1 = 0
          // }
        } else {
          Message.error({
            content: message,
            duration: 5000,
          });
        }
      });
    }

    //获取订单号
    function machinTypeFun(val: any) {
      post({
        url: "/aps/planOrder/getAutomaticInfo",
        data: {
          machinType: val
        }
      }).then(({data, code}: any) => {
        if (code === 200) {
          form.a.orderCode = data.maxOrderCode
        }
      }).catch(console.log).finally(() => {
        objectOP.pageLoading = false
      });
    };
    onMounted(() => {
      GetSon();
      doRefresh(shen.value)
      // testGetSon();

    })
    let onToCilck = (path: string, key?: string) => {
      Tchoocl.showAdd = false
      router.push({path, query: {key}})
    }
    const clothChanges = (val: any) => {
      const evenNumbers = optionsList.value.filter((res) => res['clothCode'] == val);
      guanxiForm.productName = evenNumbers[0]['brandName']
    }
    const clothChangess = (val: any) => {
      const evenNumbers = optionsList.value.filter((res) => res['brandName'] == val);
      guanxiForm.clothCode = evenNumbers[0]['clothCode']
    }

    const gridOptionXG = ref();
    const gridReadyXG = (params: any) => {
      gridOptionXG.value = params.api
      counts();
    }
    //交期
    const tableColumnsJQ = [
      {headerName: "订单号", field: "orderCode"},
      {headerName: "下单日期", field: "authorizedStrengthTime"},
      {headerName: "下单部门", field: "placeDepartment"},
      {headerName: "客户名称", field: "customOrderName"},
      {headerName: "布号", field: "clothCode"},
      {headerName: "品名", field: "productName"},
      {headerName: "匹数", field: "houseNum"},
      {headerName: "成品重量", field: "finishedWeight"},
      {headerName: "投染重量", field: "castDyeWeight"},
      {headerName: "坯布名称", field: "greyName"},
      {
        headerName: "交期",
        field: "lastDeliveryTime",
        pinned: 'right',
        cellRenderer: {
          template: `
            <a-date-picker v-if="val.productName != '合计'" class="bacClass" v-model="val.lastDeliveryTime"/>
            <div v-if="val.productName == '合计'"></div>`,
          setup(props: any) {
            let val = ref(props.params.data)
            return {
              val,
            }
          }
        },
      }];
    //缸型
    const tableColumnsGX = [
      {headerName: "订单号", field: "orderCode"},
      {headerName: "下单日期", field: "authorizedStrengthTime"},
      {headerName: "下单部门", field: "placeDepartment"},
      {headerName: "客户名称", field: "customOrderName"},
      {headerName: "布号", field: "clothCode"},
      {headerName: "品名", field: "productName"},
      {headerName: "匹数", field: "houseNum"},
      {headerName: "成品重量", field: "finishedWeight"},
      {headerName: "投染重量", field: "castDyeWeight"},
      {headerName: "坯布名称", field: "greyName"},
      {
        headerName: "缸型",
        field: "cylinderType",
        pinned: 'right',
        cellRenderer: {
          template: `
            <a-select v-if="val.productName != '合计'" class="bacClass" v-model="val.cylinderType" allow-search
                      allow-clear>
              <a-option value="E缸">E缸</a-option>
              <a-option value="S缸">S缸</a-option>
            </a-select>
            <div v-if="val.productName == '合计'"></div>`,
          setup(props: any) {
            let val = ref(props.params.data)
            return {
              val,
              listChange,
            }
          }
        },
      }];
    //车间
    const tableColumnsCJ = [
      {headerName: "订单号", field: "orderCode"},
      {headerName: "下单日期", field: "authorizedStrengthTime"},
      {headerName: "下单部门", field: "placeDepartment"},
      {headerName: "客户名称", field: "customOrderName"},
      {headerName: "布号", field: "clothCode"},
      {headerName: "品名", field: "productName"},
      {headerName: "匹数", field: "houseNum"},
      {headerName: "成品重量", field: "finishedWeight"},
      {headerName: "投染重量", field: "castDyeWeight"},
      {headerName: "坯布名称", field: "greyName"},
      {
        headerName: "车间",
        field: "workshop",
        pinned: 'right',
        cellRenderer: {
          template: `
            <a-select v-if="val.productName != '合计'" allow-search allow-clear class="bacClass" v-model="val.workshop">
              <a-option value="染部A">染部A</a-option>
              <a-option value="染部B">染部B</a-option>
            </a-select>
            <div v-if="val.productName == '合计'"></div>`,
          setup(props: any) {
            let val = ref(props.params.data)
            return {
              val,
            }
          }
        },
      }];

    //批量修改 交期、缸型、车间
    const bulkEdit = (num: any) => {
      if (gridOption.value.getSelectedRows().length === 0) {
        Message.warning('请先勾选数据')
        return
      }
      if (num == 0) {
        pageData.sideTitle = '交期修改'
        pageData.columnDefs = tableColumnsJQ
        pageData.deliveryTime = ''
      } else if (num == 1) {
        pageData.sideTitle = '指定缸型'
        pageData.columnDefs = tableColumnsGX
        pageData.cylinderTypes = ''
      } else {
        pageData.sideTitle = '指定车间'
        pageData.columnDefs = tableColumnsCJ
        pageData.workshops = ''
      }
      pageData.bulkVisible = true
      pageData.bulkList = gridOption.value.getSelectedRows()
    }

    const listChange = () => {
      pageData.bulkList.map((o: any) => {
        if (pageData.sideTitle == '交期修改') {
          o.lastDeliveryTime = pageData.deliveryTime
        } else if (pageData.sideTitle == '指定缸型') {
          o.cylinderType = pageData.cylinderTypes
        } else {
          o.workshop = pageData.workshops
        }
      })
    }

    const bulkOK = () => {
      let data: any = []
      pageData.bulkList.map((o: any) => {
        if (pageData.sideTitle != '交期修改') {
          o.lastDeliveryTime = ''
        }
        data.push({
          orderCode: o.orderCode,
          lastDeliveryTime: o.lastDeliveryTime,
          cylinderType: o.cylinderType,
          workshop: o.workshop
        })
      })
      post({
        url: "/aps/planOrder/batchUpdate",
        data: data
      }).then(({code, message}: any) => {
        if (code === 200) {
          Message.success('修改成功')
          doRefresh(shen.value);
          pageData.bulkVisible = false
        } else {
          Message.error(message)
        }
      })
    }

    // 底部合计
    function counts() {
      var sum1 = 0;
      var sum2 = 0;
      var sum3 = 0;
      for (var i = 0; i < pageData.bulkList.length; i++) {
        sum1 = sum1 + pageData.bulkList[i].houseNum;
        sum2 = sum2 + pageData.bulkList[i].finishedWeight;
        sum3 = sum3 + pageData.bulkList[i].castDyeWeight;
      }
      var nowRows = [
        {productName: '合计', houseNum: sum1, finishedWeight: sum2, castDyeWeight: sum3}
      ];
      gridOptionXG.value.setPinnedBottomRowData(nowRows);
    }

    const Confirmed = () => {
      if (pageData.deliveryStatus == 1) {
        Message.warning('交货日期已复核确认!')
      }
    }
    return {
      Confirmed,
      counts,
      bulkOK,
      listChange,
      gridOptionXG,
      gridReadyXG,
      tableColumnsJQ,
      tableColumnsGX,
      tableColumnsCJ,
      bulkEdit,
      onToCilck,
      selCxAll1,
      formRef,
      exCustomer,
      localeText1,
      xdList,
      xdhs,
      kdhs,
      kdList,
      rzdhs,
      rzdList,
      ddxzList,
      ddxz,
      greyCodeList,
      editHandler1,
      pbbh,
      Tchoocl,
      headerShow,
      selectHandler,
      pages,
      doRefresh,
      pageData,
      paging,
      shen,
      tableCon,
      tableConA,
      deleteHandler,
      trigger,
      gridOption,
      gridReady,
      gridOptionA,
      gridReadyA,
      changeGetS,
      addHandler,
      changeGet,
      tc,
      defaultColDef,
      editHandler,
      pagingChange,
      pagingSizeChange,
      fromList,
      basicData,
      Delete,
      Search,
      CirclePlus,
      EditPen,
      onSelect,
      onChange,
      onSelect1,
      onChange1,
      focusSel,
      pageDataList,
      options,
      loading,
      handleSearch,
      selectChange,
      pan,
      focusSelBh,
      handleSearchBh,
      setCxAllBh,
      focusSelSh,
      handleSearchSh,
      setCxAllSH,
      focusSelLz,
      setCxAllLz,
      router,


      sideaOKcopy,
      clothChanges,
      clothChangess,
      form,
      guanxiForm,
      testAsk,
      testAskList,
      tco,
      defaultColDefTc,
      total,
      testCriterionFun,
      objectOP,
      coloringIlluminantFun,
      coloringIlluminantSear,
      coloringIlluminantAll,
      customNameFun,
      customNameSear,
      customNameAll,
      orderNatureFun,
      getOrderNature,
      labelFormatCodeFun,
      labelFormatCodeSear,
      labelFormatCodeAll,
      repairCauseFun,
      repairCauseSear,
      repairCauseAll,
      countBu,
      sideaOk,
      yesOrder,
      yesOrderList,
      planOrderDetails,
      gridOptionyB,
      gridReadyeB,
      count,
      gridOptionB,
      gridReadyB,
      orderCustomList,
      baocun,
      guanxiData,
      sideaNo,
      guanxiCount,
      downloadHandler,
      importHandler,
      clothCodeBoSel,
      optionsList,
      clothCodeList,
      clothCodeBo,
      clothCodeSearch,
      clothCodeAll,
      pinList,
      clothCodeBoSelA,
      clothCodeListA,
      clothCodeBoA,
      clothCodeSearchA,
      clothCodeAllA,
      mobanYn,
      hugeCustomer,
      gridOptionC,
      gridReadyC,
      defaultColDefBc,
      rowData,
      planOrderDetailsAdd,
      askList,
      GetSon,
      agCellClicks,
      getSonList,
      planOderGreys,
      testGetSon,
      exchangeCalorieClassifyFun,
      exchangeCalorieClassifySear,
      exchangeCalorieClassifyAll,
      save,
      orderCodeFun,
      machinTypeFun,
      toExamine,
      xuHaoFun,
      placeDepartmentFun,
      placeDepartmentSear,
      placeDepartmentAll,
      testCriterionCk,
      shrink,
      cheCkChlorineResistant,
      cheCkResistanceYellow,
      checkDuplicateClothCode,
      mobanYnKey
    };
  },
  components: {
    textClothRequires,
    cheCkFirstRate,
    cheCkBumpWhite,
    cheCkwetRubbing,
    cheCkChlorineResistant,
    cheCkstainResistance,
    cheCkrcInfo,
    cheCkResistanceYellow,
    CheCkdialPrinting,
    cheCkrepeatPack,
    cheCKneedEnterPot,
    cheCkhyperthermiaWhite,
    cheCktakeDyeFee,
    planAddInx,
    pageTabelLayout,

    Toolbar,
    tagRender,
    cheCk,
    checheCkEdgeCK,
    selectGreyCode,
    selectGreyName,
    selectColorCode,
    selectColorName,
    selectAffirmColor,
    selectGreyType,
    selectTrimCharges,
    selectDyeingType,
    selectColorDepth,
    selectProductionMode,
    selectMachinType,
    selectWorkshop,
    cheCKStaining,
    selectOrdering,
    selectFabricNumberZ,
    selectColorCodeZ,
    selectColorNameZ,
    selectCylinder
  }
};
</script>
<style lang="less" scoped>
.pagings {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.arco-input-wrapper {
  background-color: #fff !important;
  border: 1px solid #cccccc;
}

.arco-form-item-status-error .arco-input-wrapper:not(.arco-input-disabled),
.arco-form-item-status-error .arco-textarea-wrapper:not(.arco-textarea-disabled) {
  border: 1px solid #f53f3f;
}


/********************************************** */
.stbutencx {
  background-color: #409eff;

  &:hover {
    background-color: #79bbff;
  }
}


.ag-header-cell-resize::after {
  top: 0 !important;
  height: 100% !important;
}

.ag-cell {
  border-right: 1px solid #D9DDDF !important;
}

.stbutenxz {
  background-color: #67c23a;

  &:hover {
    background-color: #b3e19d;
  }
}

.arco-row {
  margin-bottom: 0px;
}

.ag-header-group-cell-label,
.ag-header-cell-label {
  justify-content: center !important
}

.ag-header-cell,
.ag-header-group-cell {
  border-right: 1px solid #dde2eb !important;
}

/************************************************** */
.my-header {
  background-color: #fff;
}

.pagings {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.arco-input-wrapper {
  background-color: #fff !important;
  border: 1px solid #cccccc;
}

.arco-form-item-status-error .arco-input-wrapper:not(.arco-input-disabled),
.arco-form-item-status-error .arco-textarea-wrapper:not(.arco-textarea-disabled) {
  border: 1px solid #f53f3f;
}


/********************************************** */
.stbutencx {
  background-color: #409eff;

  &:hover {
    background-color: #79bbff;
  }
}


.ag-header-cell-resize::after {
  top: 0 !important;
  height: 100% !important;
}

.ag-cell {
  border-right: 1px solid #D9DDDF !important;
}

.stbutenxz {
  background-color: #67c23a;

  &:hover {
    background-color: #b3e19d;
  }
}

.el-row {
  margin-bottom: 20px;
}

.el-row:last-child {
  margin-bottom: 0;
}

.el-col {
  border-radius: 4px;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

:deep(.arco-picker input) {
  padding-left: 0 !important;
}

:deep(.arco-picker) {
  padding-left: 0 !important;
}

:deep(.arco-picker-separator) {
  padding: 0 !important;
}

:deep(.arco-tabs) {
  height: 100%;
}

:deep(.arco-tabs-content) {
  height: 100%;
}

:deep(.arco-tabs-content-list) {
  height: 100%;
}

:deep(.arco-tabs-pane) {
  height: 100%;
}
</style>